How to convert a string to an integer


Hi, I am having an issue converting a string to an integer.  



select as vendorname,
    part.num as partnum,
    part.description as partdesc,
    CAST(coalesce(,0) as Integer) as criticallevel,
    COALESCE(partreorder.reorderpoint,0) as ROP,
    COALESCE(partreorder.orderuptolevel,0) as OUL,
    cast(coalesce(qtyOnHand.qty,0) as Integer) - cast(coalesce(qtyAllocated.qty,0) as Integer) - cast(coalesce(qtynotavailable.qty, 0) as Integer) as "Qty Available",
    cast(coalesce(partreorder.orderupToLevel,0) as Integer) - cast(coalesce(qtyOnHand.qty,0) as Integer) - cast(coalesce(qtyallocated.qty,0) as Integer) - cast(coalesce(qtyNotAvailable.qty,0) as Integer) + cast(coalesce(qtyDropShip.qty,0) as Integer) + cast(coalesce(qtyOnOrder.qty,0) as Integer) as "To Order"
from part
      INNER JOIN vendorparts on vendorparts.partid =
      INNER JOIN vendor on vendorparts.vendorid =
      LEFT JOIN customset as ctpfg on ctpfg.recordid = and ctpfg.customfieldid = 73
      LEFT JOIN customvarchar as crit on crit.recordid = and crit.customfieldid = 38
      LEFT JOIN partreorder on partreorder.partid =
      LEFT JOIN qtyonhand on qtyonhand.partid =
      LEFT JOIN qtyallocated on qtyallocated.partid =
    LEFT JOIN qtynotavailable on qtynotavailable.partid =
    LEFT JOIN qtydropship on qtydropship.partid =
    LEFT JOIN qtyonorder on qtyonorder.partid =
where = 'Book'
and coalesce(, 0) > coalesce(qtyOnOrder.qty,0) - coalesce(qtyAllocated.qty,0)
I have this code in the query section of IREPORT.  But in the condition section of the query it is telling me that (ERROR: SQL Problems:GDS Exception.  35544334. Conversion error from String "B".
I also tried cast(coalesce(qtyOnOrder.qty,0) as Integer) and it is still giving me an error.  I am not sure what to do in this case.  Someone's assistance would be greatly appreciated. Thank  you!
birju's picture
Joined: May 31 2013 - 7:08am
Last seen: 8 years 7 months ago

0 Answers:

No answers yet