Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiply values in ACCESS 97 1

Status
Not open for further replies.

sanjna000

Programmer
Aug 1, 2003
132
GB
Hi guys,

I need to calculate total charges by multiply charge rate with the visit length for each client in my company. At the moment client visit is in text data type so that i really don't know how to convert text into numeric inorder to perform calculaton.

At present staff enters data as follows:
for 1/2 hr visit length = 00:30
for 3/4 hr visit length = 00:45
for 1 hr visit length = 01:00

Is any one know how to calculate total charges using these text fields?

Thank you so much for u r help in advance.
Sanju :)
 
the best way to do it, is to convert the time in minutes and multiply it by the rate. Example:

cRate = 17.00
sT = "03:54"

(val(left(<time>,2)) + (val(right(<time>,2))/60)) * <rate>

ex:(val(sT,2)) + (val((right(sT,2))/60)) * cRate
3 + .9 * 17 = 66.30

Mal'chik [bigglasses]
 
Hi Mal'chik,
Thank you sooooooooooo much for all u r help. It works fine as I expected. You are a star!!!

Sanjna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top