Solved Show results in a Field not as data but Yes or No (1 Viewer)

Number11

Member
Local time
Today, 16:29
Joined
Jan 29, 2020
Messages
607
So i have a query that looks up into a couple of tables, rather than show the serial number i just want to show Yes (its a match) or No not present?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 16:29
Joined
Feb 19, 2013
Messages
16,553
you can use the format property

if serial number is a number it would be "yes";;;"No"

or for a bit of colour

[blue]"yes";;;[red]"No"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:29
Joined
May 7, 2009
Messages
19,169
what is your Expression?

IIF(Dcount("1", "table", "the_criteria"), "Yes", "No")
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:29
Joined
May 7, 2009
Messages
19,169
using "format" will show the Yes/No, But if you enter that textbox it will reveal what is the Actual data.
 

Number11

Member
Local time
Today, 16:29
Joined
Jan 29, 2020
Messages
607
you can use the format property

if serial number is a number it would be "yes";;;"No"

or for a bit of colour

[blue]"yes";;;[red]"No"
so thats didnt work as the serial numbers are a mix of Letters and numbers :(
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:29
Joined
Oct 29, 2018
Messages
21,358
Can you post the SQL statement for your query? Thanks.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:29
Joined
Feb 28, 2001
Messages
26,999
This sounds like an "Unmatched" query, for which (I think) there is a query wizard. If you enabled wizards in your DB, you could try to make a new query that does a JOIN via the query wizards. It would show you if there is an unmatched record. However, whichever table is the "reference" table SHOULD have an index on that serial-number field. Not required, but makes it faster.

It MIGHT look something like this:

Code:
SELECT A.SerialNum, B.SerialNum, IIF( IsNull(B.SerialNum), "No", "Yes" )
FROM A LEFT JOIN B ON A.SerialNum = B.SerialNum ;

Not saying this is exactly what you want. Try the query wizard or search on "Unmatched Query" to see other examples of same.
 

Users who are viewing this thread

Top Bottom