Calculated Query

rgnsuphc

Board Regular
Joined
Mar 10, 2009
Messages
51
I need to write a calculated query that increases the price of first class tickets by 20% and regular class tickets by 10%.



In addition:
* Show the cruise line, departure date, to, from, ship and length of stay fields

First, how would you write an equation for this?
Second, where do I write it, (would it be in the criteria row?)
Third, how do I show all the fields that are typed above?




I have not used access for quite awhile, if anyone can help me out, help will be greatly appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
You need to use a query. You would have to then select the table(s) with the data n them, then select your fields, then save the query with a name like qryNewPrice and then look to add an expression where you would select teh field and multiple *.2 (which is 20%) and the next field *.1 (which is 10%). That will give you a query with the results but what do you want to do next?
 
Upvote 0
You might have to multiply by 1.2 and 1.1 to show the new prices.
In Design View of the query, use the Builder to do the calculations.
 
Last edited:
Upvote 0
Every time I run the query, every field is blank. I am not really understanding what I am doing wrong.

The equation I am using is First Class Tickets * .20 + First Class Tickets &
Regular Class Tickets * .10 + Regular Class Tickets.

Maybe I need more specific steps, I am just not sure what the problem is.
 
Upvote 0
Post your SQL statement for your query so that we can see exactly what you are doing.
 
Upvote 0
Every time I run the query, every field is blank. I am not really understanding what I am doing wrong.

The equation I am using is First Class Tickets * .20 + First Class Tickets &
Regular Class Tickets * .10 + Regular Class Tickets.

Maybe I need more specific steps, I am just not sure what the problem is.

Steps are:

Create new query
Select Table
Double click each field you want to dispaly
Change the view to see the data before next step
Save the Query with a name
Select the next empty column in query window
Select the Expression builder
Double click the field you want to calculate on, then add in *.2, click OK
Change the view to see the data with the calculation
Change the view and repeat this step (Next column)for the other calculation Field *.1
Change the view to see the results

Then tidy up and hopefully results can be seen.

If you still don't get it then post your SQL code as suggested by Alan.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top