Forum Discussion
M Query to pull only prior month data from HANA
- Anonymous3 years ago
This is what worked for me:
WHERE
(
(
"PrimaryApproval" > Add_Months(Last_Day(current_date), -2)
AND "PrimaryApproval" <= Add_Months(Last_Day(current_date), -1)
)
OR (
(
"FinalApproval" > Add_Months(Last_Day(current_date), -2)
AND "FinalApproval" <= Add_Months(Last_Day(current_date), -1)
)
AND "PrimaryApproval" = '00000000'
)
)
Hi Robert!
Thanks for the quick response. Having an issue with "DATETIME". In my attempts before posting to this board, I thought I had a solution but got this same message as I get with your suggested code:
Also, won't what you provided return data from 11/1/22 thru 12/14/22 if it was executed today?
No clue currently, sorry..