8 minutes
ago: Please note that the webserver will soon get its weekly reboot at 4:00 am Eastern Time. You may continue to use the site as normal, but you will be logged off at that time. You should be able to log right back on immediately, however. If you are in the process of placing an order, please make sure to complete it as quickly as possible, or come back after the reboot. Thank you. Sorry for any inconvenience.
Dismiss
SELECT A.*,
(SELECT COUNT(*) FROM tblNames WHERE A.ID>=ID) AS RowNum
FROM tblNames AS A
ORDER BY A.ID;
These are not very efficient so don't use them on large recordsets.
An addition to this could be adding the Ordinal or Suffix of st, nd, rd or th
Just create a Function:
Function myOrdinal (D as Integer) as String
Dim Suffix as String
Select Case D
Case 1, 21, 31: Suffix = "st"
Case 2, 22: Suffix = "nd"
Case 3, 23: Suffix = "rd"
Case Else: Suffix = "th"
End Select
myOrdinal = D & Suffix
End Function