how to realize the function as order by in SQL
feilong
Member Posts: 6
Dear all,
I am working on a customer report. The aim is get all Bill-to Customer No. , then get the all Customer records related to the Bill-to Customer No. and order by Name.
If described in SQL is:
SELECt customer.* FROM customer WHERE customer.id IN (SELECT distinct(Bill-to Customer No.) FROM customer) ORDER BY name
Any suggestion and advice is appreciated.
I am working on a customer report. The aim is get all Bill-to Customer No. , then get the all Customer records related to the Bill-to Customer No. and order by Name.
If described in SQL is:
SELECt customer.* FROM customer WHERE customer.id IN (SELECT distinct(Bill-to Customer No.) FROM customer) ORDER BY name
Any suggestion and advice is appreciated.
0
Comments
-
Create a temporary table based on the Customer table.
Fill that with code like this while running through the sales headers:
Cust.Get("Bill-to Customer No.");
TempCust.TRANSFERFIELDS(Cust);
if TempCust.INSERT THEN; //only insert if not exists.
TempCust.SETCURRENTKEY("Search Name"); //search name is normally same as Name
Then read the temporary table in an Integer dataitem to print it.0 -
Arjan, thanks a lot. Without you help, I wont finished the report so quickly. =D>0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions