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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tell if Db has not been opened today

Status
Not open for further replies.

LaurelLee

Programmer
Mar 2, 2004
117
US
I need to execute a query and append to a table once a week, on Friday. The problem is that there are a lot of people using the database throughout the day, and when it is Friday (like today) I do not want the table appended to every time the database is open. Any suggestions on how to go about this? I have the Friday date of the current week calculated within the append query, and I thought that I could just use an if statement; If Now=FridayDate, then run query.

___________________________________________________________
With your thoughts you create the world--Shakyamuni Buddha
 
Try the following....

Create a table, one field to store dates...

When the db is opened, check if today is Friday
If not Friday
Exit Code
Else
look in table for date
If found, skip out
Else
Add date to table
Whatever else you want to do
End If
End If

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
Network Admin/Access Programmer
 
Okay, so I would add the date to the table and then check to see if it was there when the database was opened each time. That makes sense to me. I was definitely thinking that it was going to be more than that.

Thanks.

___________________________________________________________
With your thoughts you create the world--Shakyamuni Buddha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top