February 11, 2005 at 10:55 am
Is anyone of you experience that your resultset is blank but in your where condition you have NOT NULL and <> ''.
I tried sp_dbcmptlevel
The current compatibility level is 80.
any ideas? or solutions to remove them?
February 11, 2005 at 12:06 pm
Maybe it's just a carriage return. Can you post the whole query so we can check it out?
February 11, 2005 at 12:32 pm
select * from dbo.SAME_NAME_DOB_GENDER
where name is not NULL and name <> ''
February 11, 2005 at 12:49 pm
What are you expecting the results to be ? When you say "blank", do you mean an empty result set (no rows returned) or there are blanks in the returned rows ?
What do diagnostic record counts show ?
ie:
select count(*) As CountNull from dbo.SAME_NAME_DOB_GENDER
where name is NULL
select count(*) As CountBlank from dbo.SAME_NAME_DOB_GENDER
where name = ''
select count(*) As CountAll from dbo.SAME_NAME_DOB_GENDER
February 11, 2005 at 1:04 pm
there are blanks in the returned rows!
What do diagnostic record counts show
ie:
select count(*) As CountNull from dbo.SAME_NAME_DOB_GENDER
where name is NULL
0 row
select count(*) As CountBlank from dbo.SAME_NAME_DOB_GENDER
where name = ''
43 rows
select count(*) As CountAll from dbo.SAME_NAME_DOB_GENDER
6904 rows
February 11, 2005 at 2:45 pm
If I understand you correctly, you are saying something like, row one has values, row two has values, row three is blank, row four through 20 has values.... etc?
Or, are you getting one row returned that is blank?
I wasn't born stupid - I had to study.
February 11, 2005 at 2:57 pm
e.g. Result below Country Zip | |
1 | |
1 | |
1 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
2 | |
2 | |
1 | |
1 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
2 | |
2 | |
2 | |
? | 1 |
? | 1 |
? | 1 |
? | 1 |
? | 1 |
? | 2 |
? | 2 |
? | 2 |
? | 2 |
? | 2 |
1 | |
1 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
american | 1 |
AMERICAN | 1 |
AMERICAN | 1 |
February 11, 2005 at 3:01 pm
I suggest at this point you take a step back and concisely describe exactly what the problem is.
If there are blank column values in the resultset, that would imply the table contains empty strings in those columns. Is that a problem ? You tell us ...
February 11, 2005 at 3:02 pm
I agree with PW. For instance, your original code was:
select * from dbo.SAME_NAME_DOB_GENDER
where name is not NULL and name <> ''
Where is Name in your output?
I wasn't born stupid - I had to study.
February 11, 2005 at 3:26 pm
yes, it is a problem that the resultset is having blank column values! I want to remove those blank values in my resultset.
Any ideas how to remove them?
i used NOT NULL and <> '', didn't work!
February 11, 2005 at 3:27 pm
my result there is just an example.
you can assume that the name same with country
name = country
February 11, 2005 at 3:34 pm
How do you know it's an empty string in the resultset, and not 1 or more spaces ?
'' <> ' ' <> ' '
Try trimming Conutry, so that empty strings, or strings of 1 or more spaces get eliminated:
Where country Is Not Null And Rtrim(Country) <> ''
February 11, 2005 at 3:56 pm
I tried Rtrim, still no luck!
February 12, 2005 at 2:05 pm
Maybe try SELECT LEN( Name), Name dbo.SAME_NAME_DOB_GENDER and see it some other character is actually in that field....
I wasn't born stupid - I had to study.
February 12, 2005 at 9:42 pm
I tried that...
some len is 2, some len is 4, etc...
any solutions?
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply