Query "And" on same field (1 Viewer)

plog

Banishment Pending
Local time
Today, 01:36
Joined
May 11, 2011
Messages
11,638
whitedove--you need to go into design view of the query I provided you and replace the field called ID with the one called Table1ID.

vba--he wants a query to identify records with both Home and Office records in Table2. Yours will pick up those with multiple Home records and no Office records (and vice versa).
 

vbaInet

AWF VIP
Local time
Today, 07:36
Joined
Jan 22, 2010
Messages
26,374
Ah alright, I understood it differently.

I'll take a back seat now that you're back online.
 

whitedove

Registered User.
Local time
Yesterday, 23:36
Joined
Jul 14, 2015
Messages
25
vba - I put your SQL code in the SQL view and still returned ID with no records.

plog - thank you for the tip, your solution actually worked! It showed table1ID with record 1 which what I wanted. But why the location column is hidden? I tried adding the location to the query in design view when I ran the query it returned empty. Is there a way to show location column?
 

plog

Banishment Pending
Local time
Today, 01:36
Joined
May 11, 2011
Messages
11,638
There is, but it won't be what you want. I mean you want to show a value that doesn't exist in your underlying data.

what you can do is add a calculated field with this code:

LocationText: "Home And Office"

It's just hard coding a string into your query.
 

whitedove

Registered User.
Local time
Yesterday, 23:36
Joined
Jul 14, 2015
Messages
25
Thank you Plog. I am just wondering how and where to start learning SQL expressions and VBA?
 

Users who are viewing this thread

Top Bottom