on 2023 Jan 10 11:07 PM
I'm trying to write a report that will give me the midpoint between two datetime fields. How can this be done?
Example #1:
if the first datetime field is 04/10/02 09:00:00AM and second is 04/10/02 10:00:00AM, then I want the midpoint to be 04/10/02 09:30:00AM
Example #2:
if the first datetime field is 04/09/02 11:00:00PM and second is 04/10/02 03:00:00AM, then I want the midpoint to be 04/10/02 01:00:00AM
Thanks in advance!
Request clarification before answering.
First you'll find the difference in seconds between the two datetimes and then you'll add half of that amount to the earlier datetime. It might look like this:
NumberVar secDiff := DateDiff('s', {first time}, {second time}) / 2;
DateAdd('s', Round(secDiff, 0), {firstTime})
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
21 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.