472,141 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

calculating time

14
help me with this. TotalTime:DateDiff("n",[starttime],[endtime])im getting mins instead of hours & mins. example" instead of 1.5 hr im getting 90. i know its something very easy to fix, but cant find it in Acess for Dummies.
Dec 13 '11 #1

✓ answered by Rabbit

DateDiff returns an integer so you can't use it for fractionals. You have to go to a lower unit and then divide. Look at my post again. I told you how to get fractionals.

6 1336
Rabbit
12,516 Expert Mod 8TB
I don't know why you would expect to get hours when you're asking the function to give you minutes. Divide the result by 60 and that will give you fractional hours.
Dec 13 '11 #2
jawbone
14
ok how do i ask the function to give me hours, thats the only formula i know to get start time and end time to work.
Dec 13 '11 #3
sierra7
446 Expert 256MB
Try
TotalTime:DateDiff("h",[starttime],[endtime])
Dec 13 '11 #4
jawbone
14
i tried that sierra it just gave me a 0 for an answer
Dec 13 '11 #5
jawbone
14
examle my time start is 11:00 and end time is 15.:15 im getting the answer 6 even thought we know that it should be 6hr15ms
Dec 13 '11 #6
Rabbit
12,516 Expert Mod 8TB
DateDiff returns an integer so you can't use it for fractionals. You have to go to a lower unit and then divide. Look at my post again. I told you how to get fractionals.
Dec 13 '11 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Adam Balgach | last post: by
4 posts views Thread by luscus | last post: by
3 posts views Thread by luscus | last post: by
3 posts views Thread by DBLWizard | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.