0

Hi I have the following code that i can run in MSSQL Query and the result are returned correctly but when i try to run it in PHP it errors what do I need to change to get it to work please.

SELECT
SUM (CASE WHEN FFP.BPARTNER.CUR_0='GBP' THEN (FFP.SORDERQ.YORIQTY_0 * FFP.SORDERP.GROPRI_0) ELSE ((FFP.SORDERQ.YORIQTY_0 * FFP.SORDERP.GROPRI_0) * FFP.SORDER.CHGRAT_0) END)
FROM FFP.SORDER
INNER JOIN FFP.BPARTNER ON FFP.SORDER.BPCORD_0 = FFP.BPARTNER.BPRNUM_0
INNER JOIN FFP.SORDERP ON FFP.SORDER.SOHNUM_0 = FFP.SORDERP.SOHNUM_0
INNER JOIN FFP.SORDERQ ON FFP.SORDER.SOHNUM_0 = FFP.SORDERQ.SOHNUM_0
WHERE FFP.SORDER.YFPSODAT_0=DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) and FFP.SORDER.SOHTYP_0!='SO6' and FFP.SORDER.YFPSOSO_0=2 and FFP.BPARTNER.CUR_0='GBP'
2
Contributors
2
Replies
19
Views
4 Weeks
Discussion Span
Last Post by Magic8Computing
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.