I'm trying to return the difference in hours and minutes between two DateTime fields.
I'm currently using the following
DateDiff ("n",{@DateTimeRecd},{@DateTimeRtd})
However, this only returns the number of mintues. Of course I can change it to DateDiff ("h",{@DateTimeRecd},{@DateTimeRtd}), but this is only hours.
I'm needing the time in hours and minutes.
Any ideas?
Thank you in advance for your assistance.
Request clarification before answering.
Morning Gary,
have you consider trying CTime? that might work. here is the example (Direct from the help file)
Returns
A Time value.
Action
CTime (number) converts the given number to a Time value; the given number is in units of 24 hours, can be fractional or negative as well.
CTime (string) converts and returns a time given a string that identifies a Time value.
CTime (dateTime) converts and returns a time given a DateTime value.
CTime (hh, mm, ss) converts and returns a time given the arguments of the hour, minute and seconds.
Examples
The following examples are applicable to both Basic and Crystal
syntax:
CTime (.2)
CTime (1.2)
Both return the same value 4:48:00 a.m.
CTime (-.2)
Returns 7:12:00 pm
CTime ("Jan. 6, 1999 2:30pm")
Returns 2:30:00 pm
CTime (#Feb. 24, 1999 2:40pm#)
Returns 2:40:00 pm
CTime (18, 30, 30)
Returns 6:30:30 pm
Comments
You can use the IsTime function to check if a String argument can be converted to a Time before doing the actual conversion. That way, if the conversion cannot be done, you can handle the situation appropriately.
Let me know how you get along with this.
Regards
Jehanzeb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.