I am having trouble sorting this out.
These are the fields from a query I wrote:
Note ID
Provider Name
Cosigner Name
Cosigner Flag (this is an expression from another query: Iif(IsNull([Cosigner Name]),"0","1")
Note Id Provider Name Cosigner Name Cosigner flag
1234 Dr. Resident 0
1234 Dr. Resident Dr. Attending 1
3456 Dr. Resident 0
What I need next is a query that will show me a distinct listing of Note ID's, but only if....the note ID has a cosigner flag =1, and if that isn't true, then show me the note ID for the cosigner flag = 0. So, if there is a cosigner show me that row, otherwise show me the row with a zero. Based on the 3 records above I would only expect to see:
Note Id Provider Name Cosigner Name Cosigner flag
1234 Dr. Resident Dr. Attending 1
3456 Dr. Resident 0
Thank you in advance for any help!!