Query using stacked data (1 Viewer)

pickslides

Red Sails In The Sunset
Local time
Today, 16:50
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

  • TEMP.accdb
    480 KB · Views: 55

Ranman256

Well-known member
Local time
Today, 02:50
Joined
Apr 9, 2015
Messages
4,337
Just make another field in the query, called MAKE: ...
 

pickslides

Red Sails In The Sunset
Local time
Today, 16:50
Joined
Apr 29, 2008
Messages
76
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;
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:50
Joined
May 7, 2009
Messages
19,247
check this out
 

Attachments

  • TEMP.accdb
    664 KB · Views: 54

Users who are viewing this thread

Top Bottom