Dates into the future

  • Hi,

    I have a part of my query that works fine for the current month.

    Thing I can'figure out is how to add 90 days to it.

    Here's what I have:

    dateadd(month, datediff(month,'19000101',CURRENT_TIMESTAMP),'19000101')

    I need this to look into the future 90 days.

  • You just want to add 90 days to what that returns?

    dateadd(day, 90, dateadd(month, datediff(month,'19000101',CURRENT_TIMESTAMP),'19000101'))

  • I think I want to do this..

    SELECT dateadd(month, datediff(month,'19000101',getdate()+ 90),'19000101')

    testing now

  • New_at_this (6/29/2012)


    I think I want to do this..

    SELECT dateadd(month, datediff(month,'19000101',getdate()+ 90),'19000101')

    testing now

    So this then?

    dateadd(month, datediff(month,'19000101',dateadd(day, 90, CURRENT_TIMESTAMP)),'19000101')

  • New_at_this (6/29/2012)


    I think I want to do this..

    SELECT dateadd(month, datediff(month,'19000101',getdate()+ 90),'19000101')

    testing now

    Don't tell us what you think you want, tell us what you do want.

    It would help if you would explain what it is you are trying to accomplish. There is more that you can do as well. Since you are new here, please take the time to read the first article I link to in my signature block below. It offers excellent guidance on what to post and how to post it to get the best answers to your questions.

  • okay thank you.

Viewing 6 posts - 1 through 5 (of 5 total)

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