Question : SQL syntax, date?

I have a this statement, calculated by code, where I'm getting the last day of any month. I'm also tagging it with the last hour, minute and second. However when I run the insert statement, the result for the last day is the first day of the next month. What's up with that?

This is MS SQL server 2008, the column type is SMALLDATETIME

Thanks,
Matt
1:
2:
3:
4:
5:
6:
INSERT INTO CostReportTimeline (ReportYear, ReportMonth, MonthName, FirstDay, LastDay, StatusFlag) 
 VALUES (2010, 2, 'February', '2/1/2010 12:00:00 AM', '2/28/2010 11:59:59 PM', 'N')

--RESULTS IN:
CostReportTimelineId	ReportYear	ReportMonth	MonthName	FirstDay	LastDay
496	2010	2	February	2010-02-01 00:00:00	2010-03-01 00:00:00

Answer : SQL syntax, date?

Random Solutions  
 
programming4us programming4us