Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mikeallenbrown
Yak Posting Veteran
72 Posts |
Posted - 2014-03-12 : 20:32:08
|
I want to exclude NULLs and blanks from this query ...having a heck of a time with the syntaxSELECT PrimaryDiag, Count(*) AS EXP FROM Patient GROUP BY PrimaryDiag ORDER BY EXP DESC -MikeMike Brown |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2014-03-13 : 02:02:15
|
[code]SELECT PrimaryDiag, Count(*) AS EXP FROM Patient WHERE PrimaryDiag is null or PrimaryDiag<>'' GROUP BY PrimaryDiag ORDER BY EXP DESC[/code]sabinWeb MCP |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2014-03-13 : 08:12:04
|
A small correction quote: Originally posted by stepson
SELECT PrimaryDiag, Count(*) AS EXP FROM Patient WHERE PrimaryDiag is NOT null or PrimaryDiag<>'' GROUP BY PrimaryDiag ORDER BY EXP DESC sabinWeb MCP
CheersMIK |
|
|
mikeallenbrown
Yak Posting Veteran
72 Posts |
Posted - 2014-03-13 : 09:25:55
|
Thank you!!-MikeMike Brown |
|
|
|
|
|