CONVERT SQL'S GETDATE() TO DB2 HUNDRED YEAR DATE

  • I am downloading a table form AS400/DB2 and must convert GetDate() in T-SQL to hundred year date so that I may query the downloaded table.

    Does anyone have a solution?

    Thanks,

    Stan

  • I think you want to capture number of days between 1900/01/01 and another date which is in your table. you can use datediff function.

    datediff(dd,startdate,enddate)

    for example -

    select datediff(dd,'1900/01/01','2008/03/05') gives you 39510

    for more - http://msdn2.microsoft.com/en-us/library/ms189794.aspx

  • Thank you very much, Jay. I will try your suggestion today!

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

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