Anyone has experience using Amazon Redshift?
I'm creating a report where I'm comparing yoy data. I'm looking to get MTD result vs Same month LY result.
Another database where i'm using below sql query where its bringing me current month
'Where Date >= DateAdd(mm, DateDiff(mm, 0, DateAdd(dd, DateDiff(dd, 0, GetDate()) - 1, 0)), 0)
and Date <= DateAdd(dd, DateDiff(dd, 0, GetDate()) - 1, 0)'
and for the PY current month I'm using this query
'Where Date >= dateadd(mm, datediff(mm, 0, getdate()) - 12, 0)
and Date <= dateadd(ms, -3, dateadd(mm, datediff(mm, 0, getdate()) - 11, 0))'
I haven't used sql or redshift that often so please help!