I've been trying to get a particular report to generate but I am having problems with getting a formula to work correctly with two if statements. I am pretty new to working with CR, so I could use a little help. I'm using the new 2008 version with MySQL db.
Everything seems to work ok when report is run thru the first if statement. But anything after that (the branch part in this case) is ignored. What am I doing improperly?
Any help appreciated.
{CUSTOMER.C_NUM} in {?Customer_Start} to {?Customer_End} and
{ORDERHDR.O_DATE} in {?Start_Date} to {?End_Date} and
If {?Sales_Order_Type} = "Order Entry" then
{ORDERHDR.O_TYPE} = "OE"
Else If {?Sales_Order_Type} = "Sale Entry" then
{ORDERHDR.O_TYPE} = "SE"
Else If {?Sales_Order_Type} = "Cash Sale" then
{ORDERHDR.O_TYPE} = "CS"
Else If {?Sales_Order_Type} = "Direct Sale" then
{ORDERHDR.O_TYPE} = "DS"
Else If {?Sales_Order_Type} = "Sale Return" then
{ORDERHDR.O_TYPE} = "SR"
Else If {?Sales_Order_Type} = "Cash Return" then
{ORDERHDR.O_TYPE} = "CR"
Else If {?Sales_Order_Type} = "Direct Return" then
{ORDERHDR.O_TYPE} = "DR"
Else If {?Sales_Order_Type} = "Branch Transfer" then
{ORDERHDR.O_TYPE} = "BT"
Else If {?Sales_Order_Type} = "Remote Order" then
{ORDERHDR.O_TYPE} = "RO"
Else If {?Sales_Order_Type} = "Quotation" then
{ORDERHDR.O_TYPE} = "QT"
Else If {?Sales_Order_Type} = "Tag & Hold" then
{ORDERHDR.O_TYPE} = "TH"
Else If {?Sales_Order_Type} = "Future Order" then
{ORDERHDR.O_TYPE} = "FO"
Else If {?Sales_Order_Type} = "Order Return" then
{ORDERHDR.O_TYPE} = "OR"
Else If {?Sales_Order_Type} = "Cash Order" then
{ORDERHDR.O_TYPE} = "CO"
Else If {?Sales_Order_Type} = "All Except BT, FO, and QT Orders" then
not ({ORDERHDR.O_TYPE} in ["BT", "FO", "QT"])
Else If {?Sales_Order_Type} = "ALL TYPES" then
{ORDERHDR.O_TYPE} <> " " &
If {ORDERHDR.O_BRANCH} = 0 then
{ORDERHDR.O_BRANCH} > 0
Else
{ORDERHDR.O_BRANCH} = {?Branch}
Everything seems to work ok when report is run thru the first if statement. But anything after that (the branch part in this case) is ignored. What am I doing improperly?
Any help appreciated.
{CUSTOMER.C_NUM} in {?Customer_Start} to {?Customer_End} and
{ORDERHDR.O_DATE} in {?Start_Date} to {?End_Date} and
If {?Sales_Order_Type} = "Order Entry" then
{ORDERHDR.O_TYPE} = "OE"
Else If {?Sales_Order_Type} = "Sale Entry" then
{ORDERHDR.O_TYPE} = "SE"
Else If {?Sales_Order_Type} = "Cash Sale" then
{ORDERHDR.O_TYPE} = "CS"
Else If {?Sales_Order_Type} = "Direct Sale" then
{ORDERHDR.O_TYPE} = "DS"
Else If {?Sales_Order_Type} = "Sale Return" then
{ORDERHDR.O_TYPE} = "SR"
Else If {?Sales_Order_Type} = "Cash Return" then
{ORDERHDR.O_TYPE} = "CR"
Else If {?Sales_Order_Type} = "Direct Return" then
{ORDERHDR.O_TYPE} = "DR"
Else If {?Sales_Order_Type} = "Branch Transfer" then
{ORDERHDR.O_TYPE} = "BT"
Else If {?Sales_Order_Type} = "Remote Order" then
{ORDERHDR.O_TYPE} = "RO"
Else If {?Sales_Order_Type} = "Quotation" then
{ORDERHDR.O_TYPE} = "QT"
Else If {?Sales_Order_Type} = "Tag & Hold" then
{ORDERHDR.O_TYPE} = "TH"
Else If {?Sales_Order_Type} = "Future Order" then
{ORDERHDR.O_TYPE} = "FO"
Else If {?Sales_Order_Type} = "Order Return" then
{ORDERHDR.O_TYPE} = "OR"
Else If {?Sales_Order_Type} = "Cash Order" then
{ORDERHDR.O_TYPE} = "CO"
Else If {?Sales_Order_Type} = "All Except BT, FO, and QT Orders" then
not ({ORDERHDR.O_TYPE} in ["BT", "FO", "QT"])
Else If {?Sales_Order_Type} = "ALL TYPES" then
{ORDERHDR.O_TYPE} <> " " &
If {ORDERHDR.O_BRANCH} = 0 then
{ORDERHDR.O_BRANCH} > 0
Else
{ORDERHDR.O_BRANCH} = {?Branch}