Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Previous 2 days of a record

Status
Not open for further replies.

scuda11

Technical User
Dec 12, 2006
5
US
Hi All, I read with interest the FAQ on calculating a birthday within the next 30 days and hope I can use something similar for my situation.

What I have is this: I have a table (tblSENESarLog), in it I have a field for the Number assigned to each Search and Rescue case (sene_case_num). I am trying to create a "pass-down" type form and report and would like to automatically have the Cases (sene_case_num) from the last 2 days displayed. I do have a Day field as well. Thanks so much in advance.

Steph

Below is the code from the FAQ:

SELECT Employees.Birthdate,

Int((Now()-[birthdate])/365.25) AS Age,

[Birthdate]+((Int((Now()-[birthdate])/365.25)+1)*365.25) AS NextBirthday,

(Int((Now()-[birthdate])/365.25)+1) AS AgeNextBirthday, [Age]+1 AS Next

FROM Employees

WHERE ((([Birthdate]+((Int((Now()-[birthdate])/365.25)+1)*365.25)) Between Now() And Now()+30));
 
> I do have a Day field as well.

Does that mean that you have a DateTime field that records the date and time of the Case?

If so
Code:
Where DayField >= DateAdd("d",-2,Date)
should give it to you.

All the age-calculation stuff doesn't appear relevant to your problem.
 
First, thanks for the reply. No, I actually have a seperate, Day, Month and Fiscal Year field. They were created before I took over the DB so it would be a huge process to change it now. I do have them setup to automatically apply the current days info when people fill out the form.

So how could I modify what you sent me to make it work, using just the Day field in my table?

Thanks a million,
Steph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top