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 |
|
djokerss
Starting Member
28 Posts |
Posted - 2004-12-28 : 21:43:04
|
| how do we know total days of month, likethis month total days is 31, january 31 etci need it to know the first date of this month is 1and the last date is 31 ( begin date and end of date of month ) |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-12-28 : 22:11:11
|
| well the first day of the month is always the first.select dateadd(dd,-1,dateadd(mm,1,convert(varchar(6),getdate(),112) + '01'))will give the last dayselect datepart(dd,dateadd(dd,-1,dateadd(mm,1,convert(varchar(6),getdate(),112) + '01')))the no of days==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
djokerss
Starting Member
28 Posts |
Posted - 2004-12-28 : 22:36:45
|
| thanks....thats what i need |
 |
|
|
|
|
|
|
|