{"id":47,"date":"2013-09-12T14:54:40","date_gmt":"2013-09-12T14:54:40","guid":{"rendered":"http:\/\/passionwind.com\/techref\/?p=47"},"modified":"2013-09-12T14:54:40","modified_gmt":"2013-09-12T14:54:40","slug":"sql-date-range-examples","status":"publish","type":"post","link":"http:\/\/techref.camellarry.com\/?p=47","title":{"rendered":"SQL Date Range Examples"},"content":{"rendered":"<h1><span style=\"font-family: 'book antiqua', palatino;\">Today<\/span><\/h1>\n<p><span style=\"font-family: 'book antiqua', palatino;\">SELECT EventTime, Event, AppTitle, AppVersion<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">FROM LOG_AutomatedApplicationRunTime<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">WHERE EventTime &gt;= DATEADD(d, 0, DATEDIFF(d, 0, GetDate()))<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">ORDER BY EventTime<\/span><\/p>\n<h1><span style=\"font-family: 'book antiqua', palatino;\">Past 30 Days<\/span><\/h1>\n<p><span style=\"font-family: 'book antiqua', palatino;\">SELECT EventTime, Event, AppTitle, AppVersion<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">FROM LOG_AutomatedApplicationRunTime<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">WHERE EventTime &lt; DATEADD(day, \u2013 30, GETDATE())<\/span><br \/>\n<span style=\"font-family: 'book antiqua', palatino;\">ORDER BY EventTime<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today SELECT EventTime, Event, AppTitle, AppVersion FROM LOG_AutomatedApplicationRunTime WHERE EventTime &gt;= DATEADD(d, 0, DATEDIFF(d, 0, GetDate())) ORDER BY EventTime Past 30 Days SELECT EventTime, Event, AppTitle, AppVersion FROM LOG_AutomatedApplicationRunTime WHERE EventTime &lt; DATEADD(day, \u2013 30, GETDATE()) ORDER BY EventTime<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[26,29,70,74],"class_list":["post-47","post","type-post","status-publish","format-standard","hentry","category-sql","tag-date","tag-example","tag-sql","tag-tutorial"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9t3oE-L","_links":{"self":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":2,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":262,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/262"}],"wp:attachment":[{"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/techref.camellarry.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}