PDA

Click to See Complete Forum and Search --> : Help... Question about SQL Server


Wen Lie
Nov 11th, 1999, 10:47 AM
Dear All...

I have a simple question...
I want to make a query like below :

Select * from trans_stock where pack_no = ''

(I want to select all field from trans_stock table where pack_no is empty / NULL).

But the problem is after I ran it, the result has failed.
Actually, if my query runs well, it will result 3 records...
But, after i run my SQL statement above, it shows that the result is 0 Record...

My question is, how can i select all fields from trans_stock table where pack_no is empty or NULL ???

Thx...

Wen Lie

Keiko
Nov 11th, 1999, 11:51 AM
Hi Wen Lie,

Select * from trans_stock where
(pack_no = '') or (pack_no is null)

in case pack_no contains space(s), you may do this ....

Select * from trans_stock where
(ltrim(rtrim(pack_no)) = '') or
(pack_no is null)

Does it help ?

Regards

Wen Lie
Nov 11th, 1999, 12:11 PM
Thx...
It helpssss........

Wen Lie