Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 adding a day to a "written" date - how to ?

Author  Topic 

fabianus76
Posting Yak Master

191 Posts

Posted - 2008-02-25 : 07:52:56
Hello !

I would like to add a day to a static date, something like this :

SELECT
dbo.Answer.ID
FROM
dbo.Answer
where answer.moment > '20080224'+1

[where '20080224' is a date : 24th of fébrurary 2008]

Looks bizzare, but I need it for a more complex query.

Thanks a lot for any help !

my favorit hoster is ASPnix : www.aspnix.com !

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-25 : 07:56:09
Dateadd(day, 1, '20080224')

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

dineshasanka
Yak Posting Veteran

72 Posts

Posted - 2008-02-25 : 08:04:45
SELECT cast('20080224' as datetime) + 1

---------------------
http://dineshasanka.spaces.live.com/
Go to Top of Page

fabianus76
Posting Yak Master

191 Posts

Posted - 2008-02-25 : 09:29:32
hi harsh athalye !

thanks a lot for your super quick answer, that's exactly what I needed !

Regards,
Fabianus

my favorit hoster is ASPnix : www.aspnix.com !
Go to Top of Page

fabianus76
Posting Yak Master

191 Posts

Posted - 2008-02-25 : 09:31:01
hi dineshasanka ! Your once is perfect, too. Thanks to you !

my favorit hoster is ASPnix : www.aspnix.com !
Go to Top of Page
   

- Advertisement -