If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Convert time to number
I have 2 Fields [TimeIn],[TimeOut]. I used the [TimeOut]-[TimeIn] the answer
come out Ok. [18:25].Now I want to Multiply [18:25]*[$23.15] answer is Err. Please advice me how to do it, I am new in the Access. |
#2
|
|||
|
|||
Convert time to number
Use the Datediff command in your query criteria. Datediff("d",[time in],[time
out]) The "d" will give you the answer in days,. If you want it in minutes, I think it is either m or mm. "houstonthai" wrote: I have 2 Fields [TimeIn],[TimeOut]. I used the [TimeOut]-[TimeIn] the answer come out Ok. [18:25].Now I want to Multiply [18:25]*[$23.15] answer is Err. Please advice me how to do it, I am new in the Access. |
#3
|
|||
|
|||
Convert time to number
On Fri, 29 Aug 2008 10:10:28 -0700, houstonthai
wrote: I have 2 Fields [TimeIn],[TimeOut]. I used the [TimeOut]-[TimeIn] the answer come out Ok. [18:25].Now I want to Multiply [18:25]*[$23.15] answer is Err. Please advice me how to do it, I am new in the Access. Is that $23.15 per hour, or per minute? In either case, an Access Date/Time value is a number - a count of days and fractions of a day since midnight, December 30, 1899. It's really not suitable for durations. I'd use the DateDiff function to calculate the number of minutes as an integer: DateDiff("n", [TimeIn], [TimeOut]) * 23.15 Divide by 60 if that number is per hour. Your expression had the $23.15 in square brackets so Access would assume that it is a (rather strange) fieldname - DON'T use brackets to surround values; they are used for the *names* of fields, tables, forms etc. but not for numeric values. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Convert time to number
You need to use the name of the result. It would look like this.
TotalTime:[TimeOut]-[TimeIn] TotalAmount:[TotalTime]*23.15 -- Please remember to mark this post as answered if this solves your problem. "houstonthai" wrote: I have 2 Fields [TimeIn],[TimeOut]. I used the [TimeOut]-[TimeIn] the answer come out Ok. [18:25].Now I want to Multiply [18:25]*[$23.15] answer is Err. Please advice me how to do it, I am new in the Access. |
#5
|
|||
|
|||
Convert time to number
On Fri, 29 Aug 2008 10:51:00 -0700, Golfinray
wrote: Use the Datediff command in your query criteria. Datediff("d",[time in],[time out]) The "d" will give you the answer in days,. If you want it in minutes, I think it is either m or mm. Actually "m" is Months; "n" is miNutes. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|