August 21, 2008 at 10:31 am
Hello
I want to extract a marketing data from a database and there is a certian field that has blank records instead of NULL.
Does any one know how I can extract the records of those with blank fields in a particular column? I have tried the IS NULL keyword within the WHERE clause but it doesnt work.
August 21, 2008 at 10:36 am
WHERE Field = ''
If you have multiple spaces then something like LTRIM(Field) = '' OR LEN(Field) = 0 (this is not performance friendly on large datasets depending on the data selectivity)
August 21, 2008 at 10:42 am
Thanks
Your a star!!!
August 21, 2008 at 10:53 am
What will i have to write to extract records that are not blank?
August 21, 2008 at 1:49 pm
Where Field = '' returns all rows that have empty string.
Where Field <> '' Returns all rows that are not empty strings.
Where Field != '' same as above.
Where Field IS NULL returns rows with a value of NULL (don't use Field = NULL)
Where Field IS NOT NULL returns rows that are not NULL (includes empty strings)
Where ISNULL(Field, '') = '' Returns rows that are null or empty string
Where ISNULL(Field, '') != '' Returns rows that are not empty strings and not null
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy