Addition and Subtraction in Query from different tables?

Hi
How do I add $0.25 to the cost of a product. Also I have data in which customers are classified according to the city. the only city in which offer discount is Glendale and only one customer belongs to that city. The discount is 10%. How do I subtract this 10% from the price of products that customer purchases?

Re-tagged.

Math is a different LO module.

Hello,

Your information is limited - no LO version, what DB is being used, info on customer.

Here is a sample:

You can add a value to an existing amount for a new amount (add $0.25 to the cost of a product) and you can use a Case statement to determine when to apply a value or default. Here your 10% discount could be Price * .9

Another sample of Case statement here → how to make a case query in Base from 2 tables

Hi
Thanks very much. I was able to add the price to the products price. The thing is I’m using Libreoffice for the very first time for my assignment. My teacher has explained everything on Microsoft Access. She just asked students with a Mac to download Libreoffice. I almost completed my assignment but I’m having problem with this query.
The exact question is Query 2: Create a parameter/update query that prompts for the incremental amount of a price increase and then prompts for the product description. Save the query as Updated Prices. Test the query by adding $0.25 to the cost of a product. View the changed price in your data-sheet view of the updated table.
Also our teacher told us to subtract the amount of discount from only Glendale city. What formula should I put so that 10% is deducted only from Glendale customer purchases?

I have edited the question. As you can see I have to take customer name, product description, quantity and then I have to create a new column of new price where every other price will remain same but only the customer from gel dale will have 10% deduction from his purchases and then finally I have to multiply the new price with the quantity and that column is total.

Also I’m attaching the formulas that she told use. When I asked her if the same formula would work in Libreoffice she said yes. But they are not working at all. My whole assignment is stuck because of this query.

@Amrita,

First, I am hopeful that data is fictitious. If no, please delete.

Second, not in the habit of actually doing assignments for someone else. Will not solve your problem. Have actually given you the direction (those formulas are for MS not LO).

The CASE statement is key. Here it is again with your field names:

 CASE WHEN "Customer Information"."City" = 'Glendale' THEN "Price" * .9 END

Edit:

A bit more on the Case statement → SQL CASE Statement

Yes the data is hypothetical.
I will try do to the query the way u are advising.
Thank you so much for your help

I did the Query like you said and I did get the result for Glendale. Thank You so much. Just one question- all the other price which were supposed to remain unchanged are not showing. What should I do with that ?

I solved the query correctly. You are awesome. Thank You Very Much. You helped a lot. I searched a lot for this query and now I finally got it…Thank you

Just one last question. While making the tables for products I formatted the price column to Currency and kept decimal to 2 points. However, when I’m multiplying the price with quantity, the result is not showing the $ sign. Even when I format the resulted column to currency and save it, still it doesn’t show the currency sign when I open it again. What should I do ?

@Amrita,

Certainly glad you have solved the situation. Guessing you also solved the non-modified prices - ‘else’ in the Case statement.

As for the formatting in the query result display, that is a currently open as a request to be completed. In other words, each time you run the query, saved or not, the formatting must be re-established. The only consistent method of display for this would be on a Form or Report.

Yes I saw how you put ELSE in the sample u sent me and tried that and it worked. :grin:
I have to make a report from the query that you helped me solve ( the one where Glendale’s discount is subtracted and other price remain same) .I have made the report and Added the currency and it is still showing the $ sign after I save it which is great. I guess this is the only option I have- dollar sign in report and not in the queries. I hope my teacher understands that.:smirk:
Thanks so much for your help.:blush::blush: You literally saved this assignment .:sweat_smile: