Date table 9converting week of the year /Day of the year to date)

  • I have a genesys date table which does not store the dates in date format rather has columns

    year , week of year , day of year, day of week.

    i need to convert this to date .. would appreciate some help here ??

    sample of table

    start_of_daystart_of_weekstart_of_monthyear_colmonth_colweek_of_yearday_of_yearday_of_week

    1515615151151562011627182 6

    15157151511515620116271837

    15158151581515620116281841

    15159151581515620116281852

    15160151581515620116281863

    15161151581515620116281874

  • This help?

    DECLARE @year_col INT = 2011,

    @day_of_year INT = 182;

    SELECT DATEADD(dd, @day_of_year - 1,DATEADD(yy,@year_col - 1900,'19000101'))

  • Or:

    DECLARE @start_of_day int = 15156;

    select DATEADD(dd, @start_of_day, '19700101');

  • Lynn Pettis (1/14/2013)


    Or:

    DECLARE @start_of_day int = 15156;

    select DATEADD(dd, @start_of_day, '19700101');

    i guess this works .... thanx 😀

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply