Link to home
Start Free TrialLog in
Avatar of Roman F
Roman FFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Roman F

ASKER

Thanks a lot, much easier :) than i was thinking... Great. Thank you for your help