Requesting assistance with sorting

  • Thread starter Thread starter subscription_junkie
  • Start date Start date
S

subscription_junkie

I am working with a field that has four numbers. This is not an autonumber
field, but stores the employeeID in a long integer format.

I am needing the report to sort by THE LAST TWO NUMBERS of the Employee ID.
So, if I have 0041, 8576, and 4529, I would need them to sort like:

4529
0041
8576

I've searched the 'net and through my Access Bible and have not found a way
to do this. If anyone can provide any assitance, it would be greatly
appreciated.
 
Add a calculated field to your query which is the Employeeid Mod 10 (Mod
returns the Remainder of X divided by Y). Then sort on this calculated
field:

SELECT MyTable.Employeeid , Mytable.[EmployeeID] Mod 100 AS SortField
FROM MyTable
Order By Mytable.[EmployeeID] Mod 100 ;
 
Back
Top