sunilvedula
Sunil
- Local time
- Tomorrow, 04:25
- Joined
- Jan 18, 2007
- Messages
- 138
Hi All,
i have a query which gives me a result of set of records. I want it to be auto numbered for making it random. I have tried several ways to increment by writing an expression but something goes wrong. For ex in the queyr that i have written like
this give me a number like 1 but it repeats the same for all the records. I just want them to be autonumbered like 1,2,3 etc....
Iwrote these function which i called in query and before i run the query:
Function IncrementValues() As Integer
IncrementVariable = IncrementVariable + 1
IncrementValues = IncrementVariable
End Function
Function ResetCounter()
IncrementVariable = 0
End Function
Can anyone let me know what i can do to get 1, 2, etc.. for all the records displayed in the query and i am not interested in inputting them in a table.
i have a query which gives me a result of set of records. I want it to be auto numbered for making it random. I have tried several ways to increment by writing an expression but something goes wrong. For ex in the queyr that i have written like
Code:
SELECT TblAccq.Pan, TblAccq.Queue, TblAccq.EmpID, TblAccq.Switch, TblAccq.REVDRAMT, TblAccq.STLMTAMT, TblAccq.[CURRTIME ], TblAccq.Action, TblAccq.Inputdt1, TblAccq.Area, TblAccq.Reasoncode, TblAccq.ATM, TblAccq.Time, TblAccq.Status, IncrementValues() AS Expr1
FROM TblAccq
WHERE (((TblAccq.Queue)=FQ()) AND ((TblAccq.EmpID)=FID()) AND ((TblAccq.Inputdt1)>=FSDATE() And (TblAccq.Inputdt1)<FEDATE()) AND ((TblAccq.Status)="C"));
Iwrote these function which i called in query and before i run the query:
Function IncrementValues() As Integer
IncrementVariable = IncrementVariable + 1
IncrementValues = IncrementVariable
End Function
Function ResetCounter()
IncrementVariable = 0
End Function
Can anyone let me know what i can do to get 1, 2, etc.. for all the records displayed in the query and i am not interested in inputting them in a table.