Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to load script, but it's saying blank field name not allowed. Same script running fine in SQL.
This is the error message.
Here is my script.
Select
ih.[Order GuID],
sum(il.[Gross Weight]) as ShipWeight,
cn.[Actual Packaging], itm.[Description],
count(il.No_)
FROM [TBW_BI].[dbo].[dreams$Sales Invoice Line] as il
inner join [TBW_BI].[dbo].[dreams$Sales Invoice Header] as ih
on il.[Document No_]=ih.No_
inner join [TBW_BI].[dbo].[dreams$Consignment] as cn
on ih.[Consignment ID]=cn.[id]
left join [TBW_BI].[dbo].[dreams$Item] as itm
on cn.[Actual Packaging]=itm.[No_]
where ih.[Ship-to Country_Region Code]='HK'
and ih.[Shipment Date]>='2016-10-01' and ih.[Shipment Date]<'2017-03-31'
group by ih.[Order GuID],itm.Description, cn.[Actual Packaging]
Can you try giving the alias for count()?? and others too.
Hi,
I am agree with Shiva, you should give alias to you calculate field but also to others.
And it will help you for you data model (to avoid sync table for example)
just try by placing the field name in between `` and see, pls note those are not single codes.
exmple,
`ih.[Order GuID]`,
sum(il.[Gross Weight]) as `ShipWeight`,
`cn.[Actual Packaging]`,
`itm.[Description]`,
count(il.No_) as 'cntno'
FROM [TBW_BI].[dbo].[dreams$Sales Invoice Line] as il
Alias worked Shiva.
Thank you
Now I have the table , I have to classify them and how many orders under each category ?
Orders/Mth 2016 | Under250g | C250to500g | C500to750g | c750gto1Kg | c1Kgto1.25Kg | c1.25Kgto1.5Kg | c1.5kgto1.75Kg | c1.75kgto2Kg | Over2kg |
Oct-16 | |||||||||
Nov-16 | |||||||||
Dec-16 | |||||||||
Jan-17 | |||||||||
Feb-17 | |||||||||
Mar-17 |
Could you attach your application in order to propose you a solution?
Giridhar, To classify your data you can defiine the intervls and use an intervalmatch() function to categorize your data.
Look at this topic about IntervalMatch(). it may be will help you.
Hi
You need count(il.No_) change:
count(il.No_) as No