Home > Archive > MS SQL Server ODBC > May 2005 > retrive all records within the Case statment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author retrive all records within the Case statment
Sam

2005-05-27, 7:23 am

i want to filter a table by a view using a defind function
for example:
select * from person
where dbo.person.company like case CmpName()
when 'all' then '%'
else CmpName()
end

prblem is that '%' doesn't show the records with NULL value
how can i
thanks
sam


Uwa Agbonile [MSFT]

2005-05-27, 8:23 pm

Try using IS NULL clause

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Regards,
Uwa Agbonile[MSFT]

"Sam" <focus10@zahav.net.il> wrote in message
news:uWyStcqYFHA.3364@TK2MSFTNGP12.phx.gbl...
> i want to filter a table by a view using a defind function
> for example:
> select * from person
> where dbo.person.company like case CmpName()
> when 'all' then '%'
> else CmpName()
> end
>
> prblem is that '%' doesn't show the records with NULL value
> how can i
> thanks
> sam
>
>



Sam

2005-05-29, 1:23 pm

"IS NULL" is not working with "=" , or "Like" operators
so i can not use it with the "CASE" statment


"Uwa Agbonile [MSFT]" <uwaag@online.microsoft.com> wrote in message
news:ez3NxhwYFHA.2572@TK2MSFTNGP14.phx.gbl...
> Try using IS NULL clause
>
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> Regards,
> Uwa Agbonile[MSFT]
>
> "Sam" <focus10@zahav.net.il> wrote in message
> news:uWyStcqYFHA.3364@TK2MSFTNGP12.phx.gbl...
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com