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 |
|
scottichrosaviakosmos
Yak Posting Veteran
66 Posts |
Posted - 2010-10-17 : 02:47:11
|
| declare @tbldate table(stdid int, sdate date, eddate date)insert into @tbldatevalues(100, '20100102', '20100505'),(101, '20100203', '20100302')i want my result set as check if day in date is 01 if not then make day as 01 and increment month my 1.scoo |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-17 : 04:24:09
|
| you can use DATEPART(dd,datefield) to get day partand to increment month by 1 use DATEADD(mm,DATEDIFF(mm,0,yourdate)+1,0)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|