Query Question

P

Pass-the-Reality

I have a table with Social Numbers. In my query I have The Field Name Social
Numbers and the criteria set as [Enter Social Number]. If the social entered
is in the table, the query populates with Social Number listed. However, if
the Social Number is not listed in the table, the query populates with a
blank cell. I want the query to populate with "No Social Listed".

I tried using SN:IIf([Social Numbers]=[Enter Social Number],[Social
Numbers],"No Social Listed")

The database can have dupliate socials so I had to set the Total to Group
By. So if the social was listed, I was getting two entries, one entry with
the Social Number and one entry with "No Social Listed".

How can I get 1 response. Either the Social Number or "No Social Listed"?
 
D

Douglas J. Steele

What's the SQL of your existing query? I'm guessing that your Group By
clause is simply

Group By [Social Numbers]

If that's correct, try changing it to

Group By IIf([Social Numbers]=[Enter Social Number],[Social Numbers],"No
Social Listed")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top