Subject: | CRM database stores datetime values Using Daylight Saving adjustment | Summary: | The CRM systsm stores datetime values in the database using DAYLIGHT Savings adjusted values. Therefore when uploading historical data, you need to take this into account.
If you default the time portion of the dates to '00:00:00:00', dates will display as ONE DAY BEFORE for date periods which fall during the daylight savings period. The best solution is to put the TIME as MIDDAY when you do not have a time portion. This way, when daylight savings adjustments are made, the date portion will not change.
This script will adjust existing data by 12 hours changing the TIME portion from 12Am to 12PM. Make sure you only run this ONCE.
-- START OF SCRIPT update vwOrders set enddatetime_c = dateadd(hour,12,enddatetime_c) where convert(varchar(12),enddatetime_c,108) = '00:00:00' update vwOrders set startdatetime_c = dateadd(hour,12,startdatetime_c) where convert(varchar(12),startdatetime_c,108) = '00:00:00' -- EMD OF SCRIPT | Audit Notes: | |
|