Unanswered: Re: Get not null or empty string is not work
Could anyone see where the error is in this IF statement?
I have three records in Shipment_history table with that work_ord_num and w/i those three records one record has a value in cust_part_num field.
I want the query return the cust_part_num value but it returns the record w/o cust_part_num.
Declare popu_tbl Cursor
SELECT TOP 100 PERCENT dbo.tblShipping_sched.work_ord_num, ...
Fetch Next From
IF @cust_part_num is null
SELECT @cust_part_num = cust_part_num FROM dbo.Shipment_history
WHERE work_ord_num like (left(@work_ord_num, 6) + '%') AND work_ord_line_num = @work_ord_line_num
AND cust_part_num <> "";
--** the line above doesn't work