Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2010-04-22 : 15:54:17
|
| Trying to pull all orders where cash is null OR emptyselect * from orderwhere order.ash_code ...and type = 'car' |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-04-22 : 16:10:02
|
| [code]select * from orderwhere order.ash_code is null or order.ash_code = ''[/code] |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-22 : 16:10:05
|
where isnull(column,'') = '' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2010-04-22 : 16:19:18
|
| yes I've already tried the is null or = '' and I get this and not really sure ...it's complaining about the datatype differences that I'm comparing:The data types text and varchar are incompatible in the equal to operator. |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-04-22 : 16:28:37
|
Your data type seems to be text. Its better you change it to a varchar data type.This should work for you.select * from orderwhere order.ash_code is null or order.ash_code like '' |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-23 : 01:27:03
|
where isnull(convert(varchar(max),order.ash_code),'') = '' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|