473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Adding up time for currency

lee123
556 512MB
i have a form that i don't know how to add up time to get a currency value is there away to do this this is what my form has in it

Fields:
1 - Qty
2 - Description
3 - Time Started (Defaulted to Now(),)
4 - Time Ended
5 - Rate Price
6 - Amount Due

i want to add up when time started with Time ended times that by the rate to get the amount. how would i do this?

Lee123
Feb 21 '08 #1
6 1720
cori25
83
In the Amount Due field on your form, right click and go to properties. Go to Row Source Type and select Table/Query, in the Row Souce(Right below), select the table/query that will have all the below fields so that you can add the below.

You will first have to determine the amount of time spent by doing this'

Duration:([Time Ended]-[Time Started])*24

Once you have populated this field, then do this'

Currency:[Duration]*[Rate Price]
Feb 21 '08 #2
lee123
556 512MB
thank you but how do you format the time in hours, because i thought in the query table you could right click the field and choose a format but i guess you can't.

Lee123
Feb 21 '08 #3
cori25
83
If you need to format the time, this is what you would do for both the start and end times in a query:

Time:Format([Start Time], "hh:mm:ss")

If you need this formatted in the form then just go to Format Cells
Feb 21 '08 #4
lee123
556 512MB
now that i have looked at what you have suggested i have noticed that the when you do this

Duration * Rate price

it's not adding up right. Example if i had a time like 2:30 pm and ended at 5:30 pm that would be 3 hours and the amount due would say $75.00 at the rate price of $25.00

using what i have explained in the example above the amount due comes out to be $380.73 on the calculations that's way too much. in my fields in the query table i have made a field named "Hours" and another one name "Amount Due" and in my hours field i have placed you code

Time Ended -Time Started * 24

in my amount due i have this

Hours * Rate Price

i don't know if i have done this right. maybe that's why the wierd figures.

Lee123
Feb 21 '08 #5
cori25
83
Duration: ([Time Ended]-[Time Started])*24

Amount: [Duration]*[Rate]

This works perfectly for me.....you have to type it the same as shown with the quotations and brackets.

If you still have no luck....take a look at what the fields are pulling into access as(text, numeric, date/time, etc...)

The time should be in the atble as a Date/Time field and the Rate should be a currency field
Feb 21 '08 #6
lee123
556 512MB
i see what i did i for got to add the parenthese in there, my bad thanks for you help (Cori25)

lee123
Feb 21 '08 #7

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

Similar topics

2
by: Willing 2 Learn | last post by:
I'm still having trouble getting my program to do arithmetic in cents(keeping all #'s) then convert the answer in a format of dollars & cents. The main program should add, subtract, scalar...
3
by: Dalan | last post by:
Is there any code available to address currency rounding problems in Access 97? Apparently, selecting currency type table fields does not resolve the problem. For instance, in my form I have a...
5
by: Jamie Pittman via AccessMonster.com | last post by:
I have two tables with 5000 entries on them. One is based for regular time with several variables example (employee name, date,time in and out, code, customer, building) I have another table that...
3
by: Mike | last post by:
I am writing this program that first asks the user to type today's exchange rate between U.S. dollars and Japanese yen, then reads U.S. dollar value and converts each. I am attemtping to use 0 or...
5
by: Steven Smith | last post by:
Hi, I'm trying to write a simple program to print invoices for people I do work for. I've got a form with textboxes for descriptions and amounts for items, and some code for printing the...
3
by: Jx4 | last post by:
Hi there, I am currently having trouble with some issues with adding Currency values. I have one column with values of transactions and the other column has a running total. It works great...
2
by: =?Utf-8?B?UmljaGFyZCBUb2NjaQ==?= | last post by:
I'm learning Visual Basic using the .Net Framework 2.0. I have been playing with consuming web services in applications. I am using a free web service that gives me information for currency...
1
by: favor08 | last post by:
I'm have automated the creation of an email from Access; whic works fine, but the new email doesn't have the user's default signature on it. Is there any way to either have it find the user's...
10
by: Guillermo_Lopez | last post by:
Hello All, I am using VBA in access to perform some calculations. There is a particular sumation that is wrong (barely). this code is withing a loop. TDist = TDist + TempDist Both TDist...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.