Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Date time now in SQL EDITOR

Hi2023
8 - Asteroid

I need help! this is in SQL EDITOR

 

  1. Ref Date should be the day the report is generated

For ex. I have the column CFG_STAT that will populating a months worth data like 4/13/2023 (it is manual now) I have to change the date each time and then the ref date should be THIS date BUT dynamically each time the report is run.

 

Also, how do I change the column CFG_STAT to retrieve 1 month data every time as well.

 

how do I do this?

 

thanks

6 REPLIES 6
FinnCharlton
13 - Pulsar

Hi @Hi2023 , I think it depends on the database you are connected to. For most SQL Servers GETDATE() will work, for a MySQL Server you might need to use CURDATE()

Hi2023
8 - Asteroid

Thanks that what I was just thinking -

 

 

what bout pulling one month data every time it is run for the column referenced?

Hi2023
8 - Asteroid

does this look right for pulling previous one month data ??

 

DateTimeFormat(CRG_STAT) >= DateTimeFormat(DateTimeAdd(DateTimeNow(), -1, "month"))

apathetichell
19 - Altair

are you on mysql? Are you in-db? In-db follows server syntax - and fields are labeled as "fieldname" vs [fieldname]

Hi2023
8 - Asteroid

hmmm I am using the SQL EDITOR in Alteryx?

apathetichell
19 - Altair

That uses "fieldname" - but also - are you on mysql? you have to use the proper SQL functions for your database.

Labels