Amazon Redshift
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
MilindG
12 - Quasar
‎06-02-2023
10:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Labels:
- Labels:
- Error Message
1 REPLY 1
apathetichell
19 - Altair
‎06-02-2023
04:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator