How to Number Records from 1-99 or Higher within Query or Report Writer?
- In Query use the ROW_NUMBER() function to create a column that will display the row number as shown in the following SQL:
ROW_NUMBER( ) OVER( ) AS "ROW",
ORDER BY 2
- Create a Macro like the following in Report Writer that will add an extra column that numbers the records from 1-? for the Entire Report.
- Alternately, to count the rows within each group use the following Macro-Derived Field in Report Writer.
TrueCount = 0
ThisRecord = 0
While (Group$=Field$("EMPID") AND Current() > 1)
TrueCount = TrueCount + 1
GetPrevious Wend if(Group$=Field$("EMPID") AND current() = 1) then TrueCount = TrueCount + 1 GetPrevious end if DerivedField Str$(TrueCount)
Last Modified On:
No, open a new Support Case
You don't have the appropriate permissions.