Query Question!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Can I make a query not show that line if the 2nd column is empty. The query
has 3 columns but don't want to show it if the 2nd column is empty


Thanks in advance.........Bob Vance
 
Something like this?

SELECT * FROM TableName
WHERE TableName.NameOfField2 Is Not Null;
 
Bob said:
Ken where do I put this script? Thanx Bob

That is the Query. You can paste it into the SQL Window of a Query, if you
wish, in the Query Builder. Be sure to use the exact names you've used in
defining the Fields in your Tables.

Larry Linson
Microsoft Access MVP
 
Brilliant Got it, :) Can I do a sort on Column1 (OwnerName) Thanx..Bob
SELECT *
FROM tblHorseOwnerPercentage
WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
 
SELECT *
FROM tblHorseOwnerPercentage
WHERE tblHorseOwnerPercentage.HorseName Is Not Null
ORDER BY OwnerName

or

SELECT *
FROM tblHorseOwnerPercentage
WHERE tblHorseOwnerPercentage.HorseName Is Not Null
ORDER BY 1
 
Oops, what is wrong with this added Unique Values to yes
SELECT *
FROM tblHorseOwnerPercentage
WHERE tblHorseOwnerPercentage.HorseName Is Not Null;
WHERE (((tblHorseOwnerPercentage.HorseName) Is Not Null));
 
Try this (catches both Null and empty string values):

SELECT *
FROM tblHorseOwnerPercentage
WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
ORDER BY OwnerName;
 
Brilliant :) Thanks....Bob

Ken Snell (MVP) said:
Try this (catches both Null and empty string values):

SELECT *
FROM tblHorseOwnerPercentage
WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0l
ORDER BY OwnerName;
 
Typo, I see:

SELECT *
FROM tblHorseOwnerPercentage
WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0
ORDER BY OwnerName;

But, I assume you corrected the typo because you made it work! ;-)
 
Yes thought 01 was a bit strange ;)

Ken Snell (MVP) said:
Typo, I see:

SELECT *
FROM tblHorseOwnerPercentage
WHERE Len(tblHorseOwnerPercentage.HorseName & "") > 0
ORDER BY OwnerName;

But, I assume you corrected the typo because you made it work! ;-)
 
Ken what do I use for conditional Format to make a cell red when it is
(Blank Empty) thanx bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top