This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am trying to use the formula function to add a column for "Item Retail" = Sales/Sales qty
If there is no sales, show "zero" instead of "#DIV/0!"
The data type is "double"
Here is what I entered in the SQL expression under IDB enviroment...
if "Daily QTY"=0 Then "Item Retail"=0, Else"Item Retail" = Daily POS"/"Daily QTY" Endif
but I continue having syntax errors for this formula when running under In database...
Unknow variable "Item Retail"
Did I miss any steps?
Depending upon the syntax of your database (not all SQL is equal):
WHEN "Sales Qty" > 0 THEN "Sales" / "Sales Qty"
Do try to google a CASE statement for your database (e.g. Oracle, SQLServer).