This has probably been asked before, so please bear with me!
Dim FirstTimeStamp As Date
Dim SecondTimeStamp As Date
Dim TimeInterval As Integer
FirstTimeStamp =07/06/2010 11:54:33 PM
SecondTimeStamp = 07/07/2010 12:24:33 AM
Both of these are in the format: mm/dd/yyyy hh:nn:ss
TimeInterval = DateDiff("n", FirstTimeStamp, SecondTimeStamp)
When I do the calculation, Access converts the format to dd/mm/yyyy hh:nn:ss (these also happen to be my regional settings) and the code bombs because the answer returned is greater than in integer! The correct answer for TimeInterval is 30
How do I get access to retain the correct format?
attached database.
hit the button on the form and see what happens!
Thanks in advance
Dim FirstTimeStamp As Date
Dim SecondTimeStamp As Date
Dim TimeInterval As Integer
FirstTimeStamp =07/06/2010 11:54:33 PM
SecondTimeStamp = 07/07/2010 12:24:33 AM
Both of these are in the format: mm/dd/yyyy hh:nn:ss
TimeInterval = DateDiff("n", FirstTimeStamp, SecondTimeStamp)
When I do the calculation, Access converts the format to dd/mm/yyyy hh:nn:ss (these also happen to be my regional settings) and the code bombs because the answer returned is greater than in integer! The correct answer for TimeInterval is 30
How do I get access to retain the correct format?
attached database.
hit the button on the form and see what happens!
Thanks in advance