- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
SQL Query custom expression - date range
I am trying to pre-filter a Query based on date range, but can't figure out how to get it to work. I keep getting this error. I have to be missing something simple, right?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: SQL Query custom expression - date range
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: SQL Query custom expression - date range
Try using
SYSDATE - 180
Jordan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: SQL Query custom expression - date range
I wasn't thinking that I needed to write it in SQL... d'uh.
This worked;
t4.Date >= CAST(DATEADD(DAY, -180, GETDATE()) as DATE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: SQL Query custom expression - date range
Created:
Aug 12, 2022 05:36 AM
| Last Modified: Aug 12, 2022 2:37 AM
(1267 views)
| Posted in reply to message from Phil_Nash 08-10-2022
You Don't need to, but I really recommend this way, because it is easy and most effective. Btw I think you don't have to typecast the date, if database column is Set up correctly You can compare as date/number directly. Of course you can Do in JSL as well, but more complicated.
Georg