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

Select last record and send result via E-mail

Status
Not open for further replies.

mrmangosir

Technical User
Dec 8, 2004
3
GB
I am attempting to run a Access DB that looks at a specific table call send.

What I want is to run a query, with the datediff function and check the difference between a datetime field in the table send and the function now(). I want to see the difference between the last record's date and the time now. If the hours using datediff ("h",1stdate,2nddate) is more than .25 then run a macro to send a E-mail.

Tried a few ways but could not get it to work.

I am not a Access expert as you can see!

Thanks

Mango
 
Tried a few ways but could not get it to work
What have you tried and where are you stuck ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried creating a query and putting in a datediff statement to check the difference. But I do not know how to check for the last record within the query and run a macro from the result of a field.

I tried running a SQL statement in VB editor, but I do not know enough to complete what I required in VB.

I either need some way of checking the last record and the difference in hours, then send a e-mail via a macro if the result is more than .25.

Or

Run a VB script, check for the last record, check the difference in hours for date from the table and now() then send a e-mail if the result is .25.

Thanks
Mango
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top