I need help! this is in SQL EDITOR
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
Solved! Go to Solution.
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()
Thanks that what I was just thinking -
what bout pulling one month data every time it is run for the column referenced?
does this look right for pulling previous one month data ??
DateTimeFormat(CRG_STAT) >= DateTimeFormat(DateTimeAdd(DateTimeNow(), -1, "month"))
are you on mysql? Are you in-db? In-db follows server syntax - and fields are labeled as "fieldname" vs [fieldname]
hmmm I am using the SQL EDITOR in Alteryx?
That uses "fieldname" - but also - are you on mysql? you have to use the proper SQL functions for your database.