how to get first and last day (as datetimes) from a datetime value?
Hey, In T-SQL I do this:declare @date datetimeset @date = getdate()--get first day of month select dateadd(m, datediff(m, 0, @date), 0)--get last day of month select dateadd(m, datediff(m, 0, dateadd(m, 1, @date)), -1) BUT when I do this is RS: for example the first day of month: =dateadd("m", datediff("m", 0, Parameters!Date.Value), 0) I get "#Error" displayed in the textbox.Also=datediff("m",0,Parameters!Date.Value) (the expression nested in the dateadd above) displayes the #Error message. So maybe that is the cause of failure for the whole expression. Now my question is ... am I using the functions in RS in a wrong way? If not and it is not possible to retrieve the dates this way, is there another elegant way of doing so? (I know some ways of generating the wanted dates but they all are very messy) Please help! Grts
July 27th, 2006 12:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics