Query using stacked data

pickslides

Red Sails In The Sunset
Local time
Tomorrow, 10:43
Joined
Apr 29, 2008
Messages
76
I have attached a DB that has three tables. In query 1 these are joined. I wished to add a column in my query for "Make". This is "Display_text" where field_name="Make".

The problem is I have already used this combination to bring across "Gender" from field_name

Kind regards, MQ
 

Attachments

Just make another field in the query, called MAKE: ...
 
Thx for the reply.

Not sure I follow, i'm making a variable for "make" i.e:

Code:
SELECT case.cust_id, case.Name, case.Start_Date, details.Display_text, details.Display_text AS Make, Sum([purchase details].purchase_amount) AS SumOfpurchase_amount, Sum([purchase details].Sales_tax) AS SumOfSales_tax
FROM ([case] INNER JOIN details ON case.cust_id = details.cust_id) INNER JOIN [purchase details] ON case.cust_id = [purchase details].cust_id
GROUP BY case.cust_id, case.Name, case.Start_Date, details.Display_text, details.field_name
HAVING (((details.field_name)="gender") AND ([field_name]="make"))
ORDER BY case.cust_id;
 

Users who are viewing this thread

Back
Top Bottom