Hi, I must first let you know I'm not very good at SQL but hope someone can help.
I'm having an issue with SQL. The error I get is the following;
ODBC Error : [SQLState : 22012] [Driver Error 8134] [Microsoft][ODBC SQL Server Driver][SQL Server]Divide by zero error encountered. [SQLState : 37000] [Driver Error 16945] [Microsoft][ODBC SQL Server Driver][SQL Server]The cursor was not declared.
When looking on the SQL table there is the following command;
LineItems.ItemPrice / LineItems.QuantityOrdered AS itemcost,
I have checked all both ItemPrice and QuantityOrdered column and all have valid numbers however, I keep getting the following message when running the query above.
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
If I comment out the command above there is no issue however, I do need the price per unit.
The item price is to be divided by the quantity ordered to give a price per unit.
I hope someone can help or at least point me in the right direction.
Thanks
p4rma