Hello, I am writting a visual basic program that connects to a progress database (db not written by me). I have the following query that works perfectly:
Now, when I modify the sql statement to include one more criteria for the WHERE statement, I get an 'Error in Rows' message back. Below is the new SQL statement, bolded is the new line:
I know that there are records where Customer = '7'....and whenever I try any other customer numbers, the same error happens (though I know they exist...).
Code:
SELECT DISTINCT pub.sol."Item-code", pub.sol."Rev-code", pub.itm."pieces-per-ctn", pub.iix."Item-desc-1", pub.sol."Customer"
FROM pub.sol, pub.itm, pub.iix, pub.cus, pub.sox
WHERE pub.sol."item-code" = pub.itm."item-code" AND
(pub.sol."Seq-Pre" = 'SO' OR pub.sol."seq-Pre" = 'RL') AND
pub.iix."Item-code" = pub.itm."Item-code" AND
pub.sol."Customer" = pub.cus."Customer" AND
pub.sol."Seq-pre" = pub.sox."Seq-pre" AND
pub.sol."Seq-num" = pub.sox."Seq-num" AND
pub.sol."Ship-flg" <> 'S' AND
pub.sol."Ship-flg" <> 'P' AND
pub.sol."item-code" <> 'SU' AND
pub.sol."item-code" <> 'CO' AND
pub.sol."Item-code" = pub.itm."Item-code" AND
pub.sol."Item-code" = pub.iix."Item-code" AND
LEFT(pub.sol."Qty-ord", InStr(pub.sol."Qty-ord", ';')-1) <> 0 ORDER BY pub.sol."Seq-pre", pub.sol."Seq-num", pub.sol."So-line"
Now, when I modify the sql statement to include one more criteria for the WHERE statement, I get an 'Error in Rows' message back. Below is the new SQL statement, bolded is the new line:
Code:
SELECT DISTINCT pub.sol."Item-code", pub.sol."Rev-code", pub.itm."pieces-per-ctn", pub.iix."Item-desc-1", pub.sol."Customer"
FROM pub.sol, pub.itm, pub.iix, pub.cus, pub.sox
WHERE pub.sol."item-code" = pub.itm."item-code" AND
(pub.sol."Seq-Pre" = 'SO' OR pub.sol."seq-Pre" = 'RL') AND
pub.iix."Item-code" = pub.itm."Item-code" AND
pub.sol."Customer" = pub.cus."Customer" AND
pub.sol."Seq-pre" = pub.sox."Seq-pre" AND
pub.sol."Seq-num" = pub.sox."Seq-num" AND
pub.sol."Ship-flg" <> 'S' AND
pub.sol."Ship-flg" <> 'P' AND
pub.sol."item-code" <> 'SU' AND
pub.sol."item-code" <> 'CO' AND
pub.sol."Item-code" = pub.itm."Item-code" AND
pub.sol."Item-code" = pub.iix."Item-code" AND
[B]pub.sol."Customer" = '7' AND[/B]
LEFT(pub.sol."Qty-ord", InStr(pub.sol."Qty-ord", ';')-1) <> 0 ORDER BY pub.sol."Seq-pre", pub.sol."Seq-num", pub.sol."So-line"
I know that there are records where Customer = '7'....and whenever I try any other customer numbers, the same error happens (though I know they exist...).