Check if the Results of two fields match? (1 Viewer)

Number11

Member
Local time
Today, 18:22
Joined
Jan 29, 2020
Messages
607
what's the best way to say if two fields in query match

[ID]=[SID],Yes,No ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 11:22
Joined
Oct 29, 2018
Messages
21,358
FieldName: ID=SID
That will work and give you either -1 or 0. If you prefer "words" as the results, you can use the IIf() function. For example:
Code:
AreTheyEqual: IIf(ID=SID, "Yes", "No")
Hope that helps...
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:22
Joined
Feb 19, 2013
Messages
16,553
sure - this in a query, same format to use in a form or report
image_2022-02-08_012132.png

or add a bit of colour
image_2022-02-08_012324.png


result
image_2022-02-08_012424.png
 

Users who are viewing this thread

Top Bottom