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 |
jim65
Starting Member
35 Posts |
Posted - 2006-05-04 : 10:02:29
|
when I used DataAdd function, like DATEADD (mm , @monthCount, @FYE), I have a FYE is '2/28/06'I can get date '3/28/06', '4/28/06' ........ How can I get '3/31/06. 4/31/06'.....the month end dates. Thanks |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-04 : 10:08:40
|
Select dateadd(month,datediff(month,0,getdate())+1,0)-1 as last_dayMadhivananFailing to plan is Planning to fail |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-05-04 : 10:29:08
|
This will find the end of month for any date:select EOM = dateadd(month,datediff(month,-1,getdate()),-1) You can also use the F_END_OF_MONTH function on this link:End Date of Time Period Functionshttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64759CODO ERGO SUM |
|
|
jim65
Starting Member
35 Posts |
Posted - 2006-05-04 : 10:41:57
|
Thanks. you guys. |
|
|
|
|
|