View Full Version : Calculating times (start to finish)


thsoundman
09-06-2007, 06:35 AM
Hey guys! Hope all is going well. Just a quick question, on the database I'm making we have both a start and finish time:

Start Finish Hrs
12:00 24:00 x



Basically what I'm wanting is for it to subtract the 12 from 24 to get x and x = 12. My problem is if I do a simple finish - start function it gives me some odd decimal. Any suggestions? I looked up a few things on microsofts site but they wanted me to add a half a page worth of code to do somthing like that. Is there anything simpler I could do?

thsoundman
09-06-2007, 06:57 AM
Ok i fixed the problem for the most part... if i make it calculate it with the field set in short time. But I still run into a problem when i have:

start finish hrs
21:00 00:00 21:00



Obviously this isn't 21 hours it's 3... Is there anyway to compensate for the null/0 value? I'm assuming I will have to insert some sort of code for this? What would I use. Unfortunatly I'm not a coder I'm more a network guy so this can be confusing for me. Thanks for any help!!! Have great day!

RuralGuy
09-06-2007, 07:48 AM
See if this link (http://www.mvps.org/access/datetime/date0004.htm) helps a bit.

thsoundman
09-06-2007, 08:29 AM
Hey thanks for the help bud! Always nice to see a fellow coloradan around as well :)

RuralGuy
09-06-2007, 08:48 AM
You're very welcome. Glad to pitch it.