Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keep getting a blank record returned 2

Status
Not open for further replies.

mrdod

Technical User
Jun 12, 2006
103
US
I am attempting to build a paredo chart and when I run my query I get the resulsts EXCEPT I am getting a blank value (Level1) with a Total of 0. Why do I keep getting a second value of nothing?

Any help would be great Thanks!!

Here is the code from the SQLView
SELECT tblcomments.Level1, Count(tblcomments.Level1) AS [Level1 Totals]
FROM tblcomments
WHERE (((tblcomments.Level1)<>"") AND ((tblcomments.Dept)="362")) OR (((tblcomments.Dept)="363")) OR (((tblcomments.Dept)="365"))
GROUP BY tblcomments.Level1;
 
How about

SELECT Level1, Count(*) AS [Level1 Totals]
FROM tblcomments
WHERE Level1 Is Not Null AND
Dept In ("362", "363", "365")
GROUP BY Level1;

If Dept is not of text data type then remove quotes
 
Vilfredo Pareto is rolling in his grave (hehe)...

It's always darkest before dawn. So if you're going to steal your
neighbor's newspaper, that's the time to do it.
 
Thanks a lot Jerry !! And thank you genomon for checking the spelling (LOL).
 
This works except when I have an entry in the Dept field but no data in the Level1 Comments field. It returns a value of 1(because there's one Dept??) but it should be 0 or "" because there are no comments. I like what you have so far!! Thanks for the help.
 
Replace this:
[tt]WHERE Level1 Is Not Null AND[/tt]
with this:
[tt]WHERE Trim(Level1 & '')<>'' AND[/tt]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PH I'll give this a try when I get back to work. I used WHERE Level1<>"" and that worked but yours is probably better....right?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top