Timezone conversion
/*
This is a sample script to demonstrate timezone conversion for date fields in CMO DWH
This script is intended to be used with SQL 2016+ and it utilises the 'AT TIME ZONE' funtion
*/
select
de.EventNumber,
de.EventDateTime [EventDateTime in UTC],
de.EventDateTime at time zone 'utc' at time zone 'Central America Standard Time' [CST],
de.EventDateTime at time zone 'utc' at time zone 'GMT Standard Time' [GMT],
de.EventDateTime at time zone 'utc' at time zone 'AUS Eastern Standard Time' [AEST]
from DimEvent de
order by 1 desc