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

Number11

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

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

plog

Banishment Pending
Local time
Yesterday, 18:44
Joined
May 11, 2011
Messages
11,646
FieldName: ID=SID
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:44
Joined
Oct 29, 2018
Messages
21,474
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, 00:44
Joined
Feb 19, 2013
Messages
16,616
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