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.
| Author |
Topic |
|
u2p_inst
Yak Posting Veteran
78 Posts |
Posted - 2003-05-10 : 07:35:35
|
| how to add datetime function with month variableexample2003-01-18 + 3(month) is 2003-04-18please help meoh |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2003-05-10 : 08:40:13
|
quote: how to add datetime function with month variableexample2003-01-18 + 3(month) is 2003-04-18please help meoh
use dateadd(datepart,number,date)foreg.dateadd(m,3,'2003-01-18')harshal.Expect the UnExpected |
 |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2003-05-10 : 10:59:36
|
| Make sure this is what you really want becausefor exampleSELECT dateadd(m,1,'2003-01-31') gets you 2003-02-28different months different amount of days. |
 |
|
|
|
|
|