Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to sort data in SQL using ORDER BY, but the formula is not working for some reason...
This is how i did it:
Load
// "No_" as DocumentNo
"Document No_"&'-'&"No_" as DocuItemNo
, "Sell-to Customer No_"as CustomerNo
, "Package Tracking No_" as PackageTrackingNo
, "Promotion Name" as PromotionName
, "Promotion ID" as PromotionID
, "Discount Description" as DiscountDescription
;
SQL SELECT
"Document No_"
, "Sell-to Customer No_"
, "No_"
, "Package Tracking No_"
, "Promotion Name"
, "Promotion ID"
, "Discount Description"
FROM "$(DB_DATASOURCE)".dbo."$(DB_COMPANY)$Sales Invoice Line";
ORDER BY "Sell-to Customer No_";
Can anyone tell me what i'm doing wrong?
Thanks,
Eline
Did you try removing the semicolon after your from statement?
e.g. FROM "$(DB_DATASOURCE)".dbo."$(DB_COMPANY)$Sales Invoice Line";
That clears up the error for me.
Did you try removing the semicolon after your from statement?
e.g. FROM "$(DB_DATASOURCE)".dbo."$(DB_COMPANY)$Sales Invoice Line";
That clears up the error for me.
Hi,
I think semicolon is your problem which you placed the order by clause after the semicolon.
If you are not clear then execute the query used here in the database whether you getting results in order.
SQL SELECT
"Document No_"
, "Sell-to Customer No_"
, "No_"
, "Package Tracking No_"
, "Promotion Name"
, "Promotion ID"
, "Discount Description"
FROM "$(DB_DATASOURCE)".dbo."$(DB_COMPANY)$Sales Invoice Line"
ORDER BY "Sell-to Customer No_";
Celambarasan
Hi,
The semicolor may be the issue. Try this
SELECT
"Document No_"
, "Sell-to Customer No_"
, "No_"
, "Package Tracking No_"
, "Promotion Name"
, "Promotion ID"
, "Discount Description"
FROM "$(DB_DATASOURCE)".dbo."$(DB_COMPANY)$Sales Invoice Line"
ORDER BY "Sell-to Customer No_";
Still if you got the error try hardcoding the DataSource and Database name and check whether this is the issue.
Hope this helps you.
Regards,
Jagan.
Thanks everyone, the semicolon was indeed the problem.