Hi all,
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.
Thanks much!
spSomething
:
Declare popu_tbl Cursor
For
SELECT TOP 100 PERCENT dbo.tblShipping_sched.work_ord_num, ...
FROM tbl
WHERE..
Open popu_tbl
Fetch Next From
While ...
Begin
--***
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 workUse:
IF @.cust_part_num is NOT null
...but why are you doing this in a cursor?
I'd almost guarantee that there are other issues with the code you have ommitted.
Showing posts with label null. Show all posts
Showing posts with label null. Show all posts
Tuesday, March 20, 2012
Subscribe to:
Posts (Atom)