Query with Difference in Total Sales

Minkowski

Board Regular
Joined
Sep 16, 2009
Messages
157
Hello everyone!
i have a DB with Total Sales for Product Alpha
the master table shows the sales i made fro today untill 2 years ago
what i want to do is this:
since i can see the sales for today and yesterday
i want the new sales=sales today-sales yesterday

i can do it with 2 queries
1)master table filtered to show sales today
2)master table filtered to show sales yesterday

then i create the difference:
Code:
Sales Made: [Today Sales Made].[Ttl Sales]-[Yesterday Sales Made].[Ttl Sales]

can i do this in one step without these 2 queries?
something like:
Code:
 [Today Sales Made].[Ttl Sales.Date()]-[Yesterday Sales Made].[Ttl Sales.Date()-1]
thanks in advance!!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Total Sales (is a field of the master table)

Code:
Sales Today: Total Sales
Criteria->Date()

Code:
Sales Yesterday: Total Sales
Criteria->Date()-1

and third field:
Code:
New Sales: [Sales Today]-[Sales Yesterday]

i believe this works...but i know there is a simpler solution
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,921
Latest member
BBQKING

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