This is a discussion on retrive all records within the Case statment within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> i want to filter a table by a view using a defind function for example: select * from person ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 > > |
| ||||
| "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... >> 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 >> >> > > |