Sorting behavior
bbrown
Member Posts: 3,268
When sorting text columns the native database will sort letters then numbers. The SQL version reverses this sort or places numbers before letters.
When using the SQL version I've been able to get the native behavior by using Navision's temporary tables. The are created on the client and behave the same in either database.
My current problem is I have a native database and need to sort a text column like SQL does. Any thought?
When using the SQL version I've been able to get the native behavior by using Navision's temporary tables. The are created on the client and behave the same in either database.
My current problem is I have a native database and need to sort a text column like SQL does. Any thought?
There are no bugs - only undocumented features.
0
Answers
-
I believe the difference is with CODE fields, not text fields. If so, then for the code field, use a text field. i.e. Populate the text field with the same data as the code field. This is how SQL sorts, as it is a character field in SQL... Obviously, if this is quite a bit of data, this is a bad idea...0
-
mstallmann wrote:I believe the difference is with CODE fields, not text fields. If so, then for the code field, use a text field. i.e. Populate the text field with the same data as the code field. This is how SQL sorts, as it is a character field in SQL... Obviously, if this is quite a bit of data, this is a bad idea...
I have used the approach you mention to get around the Code vs. Varchar behavior.
This issue is with Text fields. Create a table where the primary key is a text field. Try it in both native and SQL.
Navision (Native) gives them:
WHLASH
WH0003
WH9205
Navision SQL gives: (What they want)
WH0003
WH9205
WHLASHThere are no bugs - only undocumented features.0 -
I am probably missing something, as your example shows a pattern, but other values might produce other results, but what about sorting descending (DESC)?0
-
mstallmann wrote:I am probably missing something, as your example shows a pattern, but other values might produce other results, but what about sorting descending (DESC)?
That would result in: (not what is needed)
Navision (Native) gives them:
WH9205
WH0003
WHLASH
Navision SQL gives: (What they want)
WHLASH
WH9205
WH0003
Thanks for the responses. The search continues....There are no bugs - only undocumented features.0 -
Used ADO to hold records in memory then sorted and processed. Solution came from one of our customers.There are no bugs - only undocumented features.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
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 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