View Full Version : Query data ?


hyp527
01-16-2009, 06:48 PM
For example: i have only 1 table

tblMainTable
-mainID
-Date
-Wages

how do i used this data to query the prev wage and prev date of the next consecutive wage and date? (I want to query the prev.date and prev.wage column to see the pattern in change) . Should i break this data into 2 queries and do a comparison? Not sure how this will work.

example: tblMainTable

mainID date wages prev.date? prev.wages?
123 1/1/2009 $12 --- ----
123 1/6/2009 $2.0 1/1/2009 $12
123 1/7/2009 $12.05 1/6/2009 $2.0
123 1/12/2009 $1.05 1/7/2009 $12.05

Thanks.

HiTechCoach
01-16-2009, 08:58 PM
From Microsoft:

ACC: Referring to a Field in the Previous or Next Record (http://support.microsoft.com/kb/101081/en-us)

hope this helps ...

hyp527
01-20-2009, 09:52 AM
From Microsoft:

ACC: Referring to a Field in the Previous or Next Record (http://support.microsoft.com/kb/101081/en-us)

hope this helps ...


It does! Expr1: DLookUp("[Field1]","Table1","[ID]=" & [ID]-1) or Expr1: DLookUp("[Field1]","Table1","[ID]=" & [ID]+1) works.

Thank you.