Hi,
I would be very grateful if someone could have a look at the staement below and help me find the Syntax Error.
[code=vb]
("Select origin_of_sale as Origin, Category, Crude.F3 as Customer, sales_terms, autolift, load_point as lp, Crude.F11 as Vessel, Crude.F2 as CONTRACT_NO, VALUE_ONLY, invoice_unit, Ledger_unit, Contract_date, template_name, acct_to_group_c onversion as conv, Crude.F5, Crude.F6 as quantity, Crude.F8 as tax_quantity, Crude.F1 as participator, Crude.F14 as invoice_no, Crude.F9 as sales_date, Crude.F10 as pay_date, Crude.F12 as header, Crude.F4 as shipping, Crude.F7 as price, Crude.F13 as export " & _
"From Crude inner join t_sales_templat e on Crude.F5 = t_sales_templat e.origin_of_sal e " & _
"Where (If(Customer = 'Shell Uk Ltd' AND Participator = 'SHELL UK LIMITED' Then template_name = 'Crude - SUKO - ' & Crude.F5) " & _
"Else " & _
"(If(Custom er = 'A/B Svenska Shell' OR 'SHELL U.K. EXPLORATION & PRODUCTION' OR 'Shell Canada Ltd' OR 'Shell Canada Products' OR 'Shell Chemicals (Uk) Ltd.' OR 'Shell Chemicals Europe BV' OR 'Shell Deutschland Oil GMBH' OR 'Shell Expro UK Sector 11 (EOEL)' OR 'Shell Expro UK Sector 11 (EOP)' OR 'Shell Gas Direct' OR 'Shell Gas Limited' OR 'Shell Nederland Raffinaderij B.V.' OR 'Shell Trading Canada' OR 'Shell Trading International Limited' OR 'Shell Trading US Company' OR 'Shell Western Supply and Trading Limited' OR 'Societe des Petroles Shell' OR (Customer = 'Shell UK Ltd' AND Participator NOT 'SHELL UK LIMITED') Then template_name = 'Crude - Group - ' & Crude.F5)) " & _
"Else " & _
"(template_ name = 'Crude - Third Party - ' & Crude.F5);")
[/code]
Thanks
Towsie
I would be very grateful if someone could have a look at the staement below and help me find the Syntax Error.
[code=vb]
("Select origin_of_sale as Origin, Category, Crude.F3 as Customer, sales_terms, autolift, load_point as lp, Crude.F11 as Vessel, Crude.F2 as CONTRACT_NO, VALUE_ONLY, invoice_unit, Ledger_unit, Contract_date, template_name, acct_to_group_c onversion as conv, Crude.F5, Crude.F6 as quantity, Crude.F8 as tax_quantity, Crude.F1 as participator, Crude.F14 as invoice_no, Crude.F9 as sales_date, Crude.F10 as pay_date, Crude.F12 as header, Crude.F4 as shipping, Crude.F7 as price, Crude.F13 as export " & _
"From Crude inner join t_sales_templat e on Crude.F5 = t_sales_templat e.origin_of_sal e " & _
"Where (If(Customer = 'Shell Uk Ltd' AND Participator = 'SHELL UK LIMITED' Then template_name = 'Crude - SUKO - ' & Crude.F5) " & _
"Else " & _
"(If(Custom er = 'A/B Svenska Shell' OR 'SHELL U.K. EXPLORATION & PRODUCTION' OR 'Shell Canada Ltd' OR 'Shell Canada Products' OR 'Shell Chemicals (Uk) Ltd.' OR 'Shell Chemicals Europe BV' OR 'Shell Deutschland Oil GMBH' OR 'Shell Expro UK Sector 11 (EOEL)' OR 'Shell Expro UK Sector 11 (EOP)' OR 'Shell Gas Direct' OR 'Shell Gas Limited' OR 'Shell Nederland Raffinaderij B.V.' OR 'Shell Trading Canada' OR 'Shell Trading International Limited' OR 'Shell Trading US Company' OR 'Shell Western Supply and Trading Limited' OR 'Societe des Petroles Shell' OR (Customer = 'Shell UK Ltd' AND Participator NOT 'SHELL UK LIMITED') Then template_name = 'Crude - Group - ' & Crude.F5)) " & _
"Else " & _
"(template_ name = 'Crude - Third Party - ' & Crude.F5);")
[/code]
Thanks
Towsie
Comment