Full Version: time calculation in vb background of form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
mrbudgie
i have a if statement in the VB background of a form basicly saying:

if fieldname > 10:30 then
ect........


the 10:30 is not a time but an amount of hours so how do i put that into my if statement

cheers ian
ScottGem
Access stores date/time values as a double precision number where the integer portion is the number of days since 12/30/1899 and the decimal portion is a fraction of a day (ex: 6AM or 6 hrs = .25)

So, you would take 10.5 divide by 24 and get a number that you would check against.
Peter46
What data type are you using for 'fieldname' ?
mrbudgie
the datatype for the field name i think is set as short time
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.