This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @ClarionDate INT = 47563 | |
DECLARE @SqlDateTime DATETIME | |
-- Convert the clarion DATE into and SQL DateTime | |
SET @SqlDateTime = DateAdd(day, @ClarionDate - 4, '1801-01-01') | |
SELECT @SqlDateTime AS 'SQL Date Time' | |
-- Now convert it back from and SQL DateTime to a Clarion Date | |
SET @ClarionDate = DateDiff(day, DateAdd(day, -4, '1801-01-01'), @SqlDateTime) |