Sunday, February 19, 2012

datediff subtracting time help needed

I have a report which I am trying to get the difference of time between 2 dates. The problem is I have a date field and a separate time field for the appointment. I have a 3rd field which has both the date and time in it for the completeion time (datetimesent) I am tring to subrtact the time differences from the appointment time and time sent to get the hours it took to complete. can some one help me out.

=Datediff(Fields!APPOINTMENT_DATE.Value+''+Fields!APPOINTMENT_TIME.Value - Fields!DateTimeSent.Value)%1440

Hi CPowers,

try the following

=Datediff( CDATE(Fields!APPOINTMENT_DATE.Value + ' ' + Fields!APPOINTMENT_TIME.Value) - CDATE(Fields!DateTimeSent.Value) ) % 1440

all the best

|||

I tried what you sent me but I get and error

Operator '-' is not defined for types "Objects" and "Date" I also tried the second post and get the same results.

|||

I tried what you sent me but got the error below do you have any suggestions

Operator '-' is not defined for types "Object" and "Date"

|||

=Datediff("d", CDATE(Fields!APPOINTMENT_DATE.Value + ' ' + Fields!APPOINTMENT_TIME.Value) , CDATE(Fields!DateTimeSent.Value) )

this will give the no of days between the specified dates.

refer this

http://msconline.maconstate.edu/tutorials/VBNET/VBNET01/vbnet01-07.aspx

|||

Please refer this URL http://msdn2.microsoft.com/en-us/library/aa337153.aspx. You could make use of both the DateAdd and DateDiff functions.

No comments:

Post a Comment