compering between current record to previus record

Allen90

New member
Local time
Today, 18:05
Joined
Aug 9, 2012
Messages
9
Hi everybody!

So I got this problem where I need to compere between the date I entered in my current record to the date I ebtered on my previus record, I have no problem using code, but I am new to access (2007).
I'm using a ShortDate input masking, how can break it down and compere between days and months?
 
Is there an ID an auto incrementing number that uniquely identifies each record? How do you determine the previous record?
 
yes, the records are numberd with an ID
 
You could always use the DMax() function to find the maximum value of the ID that is less than the current ID.

Caveat Emptor;
Using this method you do need to be aware of the limitation of the AutoNumber field if you are using it to allocate your ID
 
thenks :)
so now I have my current date (date[ID]) and my previus date (date[ID-1]).
is compering them while in a ShortDate formet velid?
and how can I use specific parts of the dates, day alone and months alone?
 
Using the Day() and Month() functions or the Format() function. The previous date may not always be CurrentDate - 1 so you will need to:

1. Create a query based on your table sorted by the Date field in Descending order.
2. Use the DLookup() or DMax() function to get the value with a criteria of Datefield < CurrentDate
 
I think I got the hang of it :)
well thank you all, I'll be following your instruction now!
 

Users who are viewing this thread

Back
Top Bottom