Hi,
I need to perform dateadd function on one of my columns in my report.
So I assigned an expression to that column which goes like this.
=Dateadd(DateInterval.Hour,Fields!InitialDrive.Value,Fields!EarliestArrivalTime.Value)
It doesnt look like working... It comes out in the report as #ERROR
Where am i going wrong?
Regards,
Lavanya.
you need 3 arguments
DATEADD(datepart,number,date)
Arguments
Can you do the DATEADD in the stored procedure that you run?
Yeah... I have 3 arguments
|||Yeah... I can go with Stored procedures... But I am not sure how to add decimal number
DATEADD(hh,1.25,10/22/2007 8:00 AM) and it shud give me 10/22/2007 9:15 AM
Any idea how to do it...
||| The commands
DECLARE @.TEST DATETIME
SET @.TEST = CONVERT(DATETIME,'10/22/2007 8:00 AM')
PRINT @.TEST
PRINT DATEADD(hh, 1.25, @.TEST)
PRINT DATEADD(mi, (1.25 * 60), @.TEST) -- note use of mi (orminute)
give
Oct 22 2007 8:00AM
Oct 22 2007 9:00AM
Oct 22 2007 9:15AM -- The answer you require!
Yes! the DateInterval.xxx is units of the integer of the second argument (Tricky)
No comments:
Post a Comment