multiply query

Forum home » Delegate support and help forum » Microsoft Access Training and help » Multiply in Query

Multiply in Query

resolvedResolved · Urgent Priority · Version 2007

Vivien has attended:
Access Introduction course
Access Intermediate course

Multiply in Query

How do I muliply in a query.
I have one field working hours and one field rate per hour, this are fields from 2 different tables, but I am not quite sure how i multiply them for total hours per person.
Many thanks

RE: Multiply in Query

Hello Vivien,

Thank you for your question regarding calculation in query.

In the query grid you need to have both the fields that contain the hour rate and working hours. In the next available column, type the following: totalhours:[rate per hour field]*[working hours field]

the first part can be called anything, thats the name of a new field. in square brackets you must spell the names of the fields you want to multiply exactly as they are in each table.

Hope that helps.


I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

RE: Multiply in Query

Hi Mark thank you for your answer, however if I do that it is asking me for the value of the hourly rate field and the Hours worked Field, but the all have different rate and hours.

Would it be better to do it in a report as they 1 Person has an entry every day and I need the total of this hours multiplied by the hourly rate to get the total for the month.

Many Thanks.
Vivien

RE: Multiply in Query

Hi Mark,

I tried it again in a few ways but it doesnt bring me the result I want.

So I start again, I have one employee table with a field Hourly rate(as each employee has a different rate.
Then I have a table Working hours, where I put in the hours they have done every day.
Basically I want to have a report in the end where I can see all their hours worked -sum it u in the end(which I have done and it runs well) but I also want to have the Sum*hourly rate(which is in table Emoloyee list)-I do not want to have to look for the rate for each employee every time i make a new entry(as that happened when I did it with a looking up wizard). Hope I didnt confuse you and you can help.

Many Thanks
Vivien

RE: Multiply in Query

Hello

The method I gave you, if it was prompting for the figures each time, you would have been spelling the field names incorrectly! You should be creating a Query, with the two fields you want to calculate. after you add these to the query, run the query... you should see a datasheet list of all the rates charged and hours worked per record.
Return to design view. Add a new field by typing directly in the field row of the query grid, call this whatever you like, followed by Colon. Then type square bracket and within type the name you have called the hours worked field, exactly as it appears in the table, close square bracket. Type * then open square bracket and the name of the field of the hourly rate, close square bracket. Your whole field line should look like this.
totalpaid:[hours field name]*[hourly rate field name]

run this query, you should see results.. if you get a dialog box pop up, you have mis-spelt the field names!
if you still have problems send me a sample of your database mm@stl-training.co.uk




I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

Sun 20 Mar 2011: Automatically marked as resolved.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Relationship maps

It is important to create proper relationships between tables. You can use Access to help check your designs and evaluate them by printing them in graphical format to help with design purposes


Click on the Tools menu, click Relationships.
On the File menu, click Print Relationships. View or print as required

View all Access hints and tips


Server loaded in 0.07 secs.