Skip to content

Instantly share code, notes, and snippets.

@dnasca
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save dnasca/841539ef00094a38a7b7 to your computer and use it in GitHub Desktop.

Select an option

Save dnasca/841539ef00094a38a7b7 to your computer and use it in GitHub Desktop.
Date Range
exec (' SELECT DISTINCT '
+ @SearchField + ' FROM SchemaAudit WHERE StartDate >= '
+ Convert(varchar(20), @DateFrom)
+ 'AND WHERE EndDate >= '
+ Convert(varchar(20),@DateTo)
+ ' ORDER BY '
+ @SearchField
+' ASC')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment