Home Between dynamic dates
Reply: 0

Between dynamic dates

user740
1#
user740 Published in June 23, 2018, 9:17 pm

So part of my query, I would like to filter the results to show just the ones between a set date range, however, that date range is dynamic, based on an event.

For example:

WHERE date d
   BETWEEN '2017-01-01'         -- just a sample fixed date
   AND DATEADD(D, CONTACT_DATE, -1) -- to show a day before Contact Date

Basically just trying see if there was another CONTACT_DATE this year, excluding the day of the actual contact.

I know there could be other ways to do this, but I was wondering if I can tweak a query with the current logic.

ERROR:

Argument data type datetime is invalid for argument 2 of dateadd function.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311719 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO