Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Querying a 6 month Date Range

Soxfaninfl
8 - Asteroid

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

5 REPLIES 5
Claje
14 - Magnetar

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.

Soxfaninfl
8 - Asteroid

The table is a SQL table, so your saying I would use WHERE [columnname] > DATEADD(mm, -6, GETDATE())? This does work in sql server.

ZacharyM
Alteryx Alumni (Retired)

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())

Claje
14 - Magnetar

++ @ZacharyM's post - that's exactly how I'd recommend solving for this issue.

Soxfaninfl
8 - Asteroid

Thanks everyone for the help!

Labels