March 15, 2011 at 2:10 pm
I have a table with one column called open filled with some data but there are some cell which are null(blank), I want to run a query
to get only the open column with data without getting the null.
I try this open IS NOT NULL but I am still geting some null values.
Any help
March 15, 2011 at 2:23 pm
Please show the query, table DDL and sample data
March 15, 2011 at 2:33 pm
Maybe you are getting blanks, not NULL .... they are not the same
try:
where open > ''
March 16, 2011 at 6:39 am
Homebrew
I tried Open > " and it turn to Open > '""'. But it did not work
I am still getting null value
my query is simple
select open from view_rpt
where open is not null
I just dont want the blank cells in the column or row.
Thanks
March 16, 2011 at 6:43 am
Blank and null are not the same.
Can you maybe attach a screenshot that shows the data?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 16, 2011 at 7:07 am
This is how it looks like.
Open
NULL
R252
R253
NULL
March 16, 2011 at 7:11 am
Are any rows returned by the following?
... WHERE Open = 'NULL'
... WHERE Open IS NULL
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 16, 2011 at 7:48 am
Some rows are returning NULL and I don't need
the rows with NULL to be returned.
March 16, 2011 at 8:37 am
I have a column that looks like this
Open
NULL
R252
R253
NULL
or
Openid open
r252 abc
cde
r253 ghi
jkl
I want to get rid of the blank openID
in my query I try using IS NOT NULL but that doesnt work
any help
March 16, 2011 at 8:39 am
Does this return something?
select open
from view_rpt
where open = 'null'
I suspect that application might be storing 'NULL' and not NULL.
March 16, 2011 at 8:41 am
Are the "missing" ones NULL or empty string? have you tried something like
Where IsNull(open, '') <> ''
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 16, 2011 at 9:03 am
I have come a cross this code below
=IIF(IsNothing(Fields!Product.Value),"NO","YES")
Instead of returning both no and yes, I want only yes but
with the open_id
March 16, 2011 at 9:05 am
That is not T-SQL.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
March 16, 2011 at 9:08 am
Please show some sample data and explain what you are trying to do. Your explanation of what you need and what is happening is lacking details. Write more information about what doesn't work.
If the IIF code is not related to the NULL question, start a new thread. Don't continue to use this one as a catch all for all issues you have.
March 16, 2011 at 9:37 am
Oh ok maybe that is why a simple query is turning into something big.
Thanks
Viewing 15 posts - 1 through 15 (of 28 total)
You must be logged in to reply to this topic. Login to reply