Hi guys,
I was trying to create report.
this is the code that i used.
Whenever I try to execute the report,
this error appears :
{"service":"","errors":[{"message":"An unpredicted error occurred while executing service.\nThe root cause of the error is: Unexpected character ('1' (code 49)): was expecting comma to separate Object entries\n at [Source: (StringReader); line: 1, column: 6602]"}]}
-----------------------------------------------------------------
SELECT
[Day]
,SUM(Qty) as 'Qty'
,SUM(Shop) as 'Shop'
,SUM(Octopus) as 'Octopus'
,SUM(CreditCard) as 'CreditCard'
,SUM(Amount) as SalesByUS$
FROM (
SELECT
CAST (FORMAT (TxnDate, 'MMM - dd') as NVARCHAR(10)) as 'Day'
,sum(Qty) as Qty,
isnull(Shop,0) as Shop ,
isnull(Octopus,0) as Octopus,
isnull(CreditCard,0) as CreditCard,
sum(amount) as amount
FROM (
SELECT
CAST(sh.TxnDate as Date) as TxnDate,
CAST(SUM(
CASE
WHEN ProdCode = '1301100' THEN Qty*3
WHEN ProdCode = '1301000' THEN Qty*3
WHEN ProdCode = '1302000' THEN Qty*3
WHEN ProdCode = '1302100' THEN Qty*3
WHEN ProdCode = '2501100' THEN Qty*5
ELSE Qty
END
) as INT) as Qty
,CASE when CurrencyName1 = 'Online' THEN sum(Qty) end as Shop
,CASE when CurrencyName1 = 'Octopus Exception' THEN sum(Qty) end as Octopus ,
CASE when CurrencyName1 not in ('Octopus Exception', 'online') THEN sum(Qty) end as CreditCard ,
sum(NetAmount) as Amount
FROM Sales_H sh
INNER JOIN Sales_P sd on sd.TransNum = sh.TransNum
INNER JOIN Sales_Q st on st.TransNum = sh.TransNum
INNER JOIN STAFF ps on ps.StaffID = sh.CashierID
INNER JOIN BUY_CURRENCY bc on bc.CurrencyID = st.TenderID
WHERE CurrencyID NOT IN (1,16)
AND st.TenderAmount != 0
AND ProdDesc != 'PLASTIC BAG'
AND NetAmount != 0
AND month(sh.TxnDate) = $P{Month}
AND year(sh.TxnDate) = $P{Year}
GROUP BY cast(sh.TxnDate as DATE), CurrencyName1
) A
GROUP BY TxnDate, Shop, Concierge_Octopus, Concierge_CreditCard) tblFinal
Group BY [Day]
Can you help me how to fix this? thank you in advance!
Could you explain what this has to do with Atlassian stuff?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.