Query – group by 2 like fields in a table

Jcwishart

Registered User.
Local time
Today, 06:14
Joined
Apr 18, 2006
Messages
11
My table looks like this:
Sales(a)||Date(a)||Sales(b)||Date(b)||Sales(c)||Date(c)
1) 50 05/06 75 06/15 100 08/15
So I want to show all sales with the criteria - Date >05/01 <07/01.
The final query totals will be
Sales||Date
50 05/06
75 06/15
So the issue is that there are 38 rows with similar data in each column
I have the table in this format because I also have a form that feeds off this table and it needs to be in this format-but I would also like to run a query/report from this table that summaries sales. I also know that since there is more than 1 date value in the row, this is going to make the query difficult to run (each date is linked to a certain sales total).
I guess what I want to do is transfer the horizontal data to vertical data (with certain criteria)
Please help!!!
 
Use a union query to make it a 'real' table again

Select [Sales(a)],[Date(a)] from yourtable
union all
Select [Sales(b)],[Date(b)] from yourtable
union all
Select [Sales(c)],[Date(c)] from yourtable

Then use this query as input to your group by query...
 

Users who are viewing this thread

Back
Top Bottom