We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

SQL Date filters - functions

rgvital
5 - Atom

I'm looking to see if it's possible to apply a date filter in the SQL of a data pull rather than use the filter "tool".  As I want the filter selection on the database, not within Alteryx.

 

Here's a hard coded version of what I have against a Hive ODBC connection...

 

where business_dt = date('2024-09-02')

 

But I would like to have..

 

where  business_dt = date(PriorBusinessDate)

 

Is there a function I can use within SQL to accomplish this?

thanks

2 REPLIES 2
alexnajm
18 - Pollux
18 - Pollux

@rgvital while many people can probably help, this seems like more of a SQL question than an Alteryx question. The SQL may also depend on if its SQL Server, Snowflake, Oracle, etc.

 

As a start,, here's something: How to get Previous business day in a week with that of current Business Day using sql server - Stac...

TUSHAR050392
11 - Bolide

Hey @rgvital There is no function which can give you previous business date in SQL. You might have to use some database which gives you details on whether a business date was a working day, weekend or holiday and then on top of that you can build a macro to give you the previous business date in alteryx

Labels
Top Solution Authors