Querying a 6 month Date Range
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Everyone,
I'm trying to query data in table for a specific date range, and I want to pull data going back as far as 6 months from the current day. I don't want to use the filter tool because this table has over 77 million records. Does anyone have a expression available I could use in a input tool for the column that I'm trying to query on? No I can't use in database tools for this workflow.
Thanks,
mackedet
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A solution for this would depend on what type of database you are using. Can you provide that information?
Roughly, most database languages (SQL, MySQL, etc) can support this kind of dynamic range, so you would want to write this pull with that filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The table is a SQL table, so your saying I would use WHERE [columnname] > DATEADD(mm, -6, GETDATE())? This does work in sql server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, tag a standard SQL syntax based WHERE statement to the end of your query in the Query Editor and this will accomplish what you want.
WHERE [columnname] > DATEADD(month, -6, GETDATE())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
++ @ZacharyM's post - that's exactly how I'd recommend solving for this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks everyone for the help!
