Roman F
asked on
Calculate the difference in access between two dates
i have two fields: TimeFrom and TimeTo
data Type is text.
TimeFrom 07:15 AM, the format is HH:mm AM
TimeTo 10:15 AM
(07*60)+15=435
(10*60)+15 AM=615
615-435=180
the difference is 180 minutes
TimeFrom 10:50 AM
TimeTo 02:30 PM
(10*60)+50=650
the difference is 220 minutes
((02+12)*60)+30=870 ' pm needs to add 12
870-650=220
how to calculate the difference in access query, considering time format, AM or PM in single query
select DateFrom, DateTo ,Duration from tblTable
data Type is text.
TimeFrom 07:15 AM, the format is HH:mm AM
TimeTo 10:15 AM
(07*60)+15=435
(10*60)+15 AM=615
615-435=180
the difference is 180 minutes
TimeFrom 10:50 AM
TimeTo 02:30 PM
(10*60)+50=650
the difference is 220 minutes
((02+12)*60)+30=870 ' pm needs to add 12
870-650=220
how to calculate the difference in access query, considering time format, AM or PM in single query
select DateFrom, DateTo ,Duration from tblTable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER