This question is based on a previous question I asked awhile back, that was solved.
For reference this is the link to that question: https://www.experts-exchange.com/questions/29174149/Issue-with-SQL-join-with-4-tables-where-one-is-a-parent-Table.html
So that code is working just fine, but I needed to make a few changes:
1) I've had to add a XTD Column, which is similar to the TD Column.
2) I've changed the reference Columns for the Permits
The changes I've done work pretty good, however I'm having an issue sorting one column.
First here is the working code:
Now for the issue. I'm ordering the list by XTDNumber, descending, but it's messing up the order a bit.
Here is the output of the above code:
So the issue is XTD 201-10.0, it's supposed to be at the top.
The order wasn't an issue when I was sorting just a TDNumber in my last question, it was purely a Decimal number.
Now it's a VARCHAR/String, and it's not quite doing what I need.
To complicate things the Twenty is the year the document is created, so in January the last number will reset, to 21-1. That may not complicate things, just that the first number is not static.
I'm thinking a possible solution might be to keep sorting by TDNumber, rather than XTDNumber, but keep it hidden?
Any help would be a appreciated.