Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with jul_dat as
- (
- select dd1 / 1000 yyyy,
- dd1 % 1000 days_since_1,
- cast( cast(dd1 / 1000 as varchar) + '-01-01' as datetime) jan_1_of_year
- from
- (
- select 9999999 - @dat dd1
- ) x
- )
- select jan_1_of_year + days_since_1 - 1 from jul_dat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement