I have an sql statement that I have run in Oracle but has problems in visual basic. I have narrowed the problem down to the to_number function. Anyone have any idea why I can't use this in VB? Is there something else I can use?
The reason I am using it is because my column item_num is a Varchar2, when I do an order by on it, it doesn't always sort correctly. I have had a 9 become before an 11. So I used to_number(item_num) in Oracle and it corrected the problem. However in VB it doesnt do anything.
Here is the sql. I am using rdo
sqlCAP = "select prod_id, prod_num, item_num, " _
& " release_date, prod_status " _
& "from PRODUCTS " _
& "where prod_id = '" & RSprod_id!Issn & "' " _
& "and current_prod = 'Y' " _
& "order by to_number(prod_num) desc, " _
& "to_number(item_num) desc "
The reason I am using it is because my column item_num is a Varchar2, when I do an order by on it, it doesn't always sort correctly. I have had a 9 become before an 11. So I used to_number(item_num) in Oracle and it corrected the problem. However in VB it doesnt do anything.
Here is the sql. I am using rdo
sqlCAP = "select prod_id, prod_num, item_num, " _
& " release_date, prod_status " _
& "from PRODUCTS " _
& "where prod_id = '" & RSprod_id!Issn & "' " _
& "and current_prod = 'Y' " _
& "order by to_number(prod_num) desc, " _
& "to_number(item_num) desc "