SQL Error

Dear Friends,

Do you see a syntax error in this SQL?

"SELECT sum(qtyonhand) FROM PUB.locationMstr WHERE Not (loc) Is Null AND LCASE(loc)='sin' AND item= '" & txtMasterItem.Value & _"' AND lot= '" & txtM_Lot.Value & "'"

I added Not (loc) Is Null AND LCASE(loc)='sin' to filter by location 'sin'.

asp .net app is using datadirect ODBC from 91e PROGRESS to fetch records from PROGRESS DB.
Pl assist.
 
Top