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!

records from the prev 24 hours

Status
Not open for further replies.

scuda11

Technical User
Dec 12, 2006
5
US
Hi all, new to the forum, and Love it!! I have a "pass-down" kind of a log that I am creating. What I would like is to have a "snapshot" of the previous 24 hours, mainly just for 2 or 3 fields of my table. For example, we are a Search and Rescue unit and on this report I would like the Search and Rescue cases for the prev day. I have a field called sene_case_num and I would like the entries to that field from the last day reported. I do have a month and day field in my table.

Thanks!
 
Hi scud,

Good for you with the 'Search & Rescue' work. (I'm afraid that I'm too selfish myself).

When you say 'month and day' field, are these 2 seperate fields?

If so, then you really should store only the date/time (if you can change it at this stage), as both month and day can be found from a single date field, and getting a previous days records would be as simple as:

select records where rescueday = date() - 1

(Date() is today, and taking 1 off it gives you yesterday by default).

Here's an excellent FAQ - please star the author if you find it useful.....

thread705-495137

ATB

Darrylle








Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Hi darryle, thanks for the response! I do have 2 fields, it was that way when I took over the DB, and when I became knowledgable enough to change that, it was too late!!!

I do it have to auto-insert the current date time, which is great.

So, since I have a seperate setup can I use:

select records where rescueday = day() - 1

or

Could I create a new hidden field on my form (from my table) and have THAT be a date/time ?

Thanks again, much appreciated!
 
Also, and sorry for re-posting before you replied, but I am a little familar with queries but it is admittedly my weak point. Is that just SQL code you gave me/

TA,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top