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

Number11

Member
Local time
Today, 19:50
Joined
Jan 29, 2020
Messages
278
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, 19:50
Joined
Feb 19, 2013
Messages
12,955
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

error reading drive A:
Local time
Tomorrow, 02:50
Joined
May 7, 2009
Messages
12,384
what is your Expression?

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

arnelgp

error reading drive A:
Local time
Tomorrow, 02:50
Joined
May 7, 2009
Messages
12,384
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, 19:50
Joined
Jan 29, 2020
Messages
278
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, 11:50
Joined
Oct 29, 2018
Messages
14,942
Can you post the SQL statement for your query? Thanks.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:50
Joined
Feb 28, 2001
Messages
19,699
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