community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Querying a 6 month Date Range

Meteoroid

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

Pulsar
Pulsar

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.

Meteoroid

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

Alteryx
Alteryx

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

Pulsar
Pulsar

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

Meteoroid

Thanks everyone for the help!

Labels