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!

Timestamp on Report

Status
Not open for further replies.

MTBChik

Technical User
Jun 19, 2001
58
US
I think I've been looking at this too long and feel like I'm beating my head against the wall.

I am trying to add an expiration date to my report based on NOW() and adding 10 days to it. Ultimately, I'd like the report to expire in an hour, but I'm trying to break the peeps in slowly...

Any hints greatly appreciated!

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
Have you looked at the DateAdd() function?

"Teamwork means never having to take all the blame yourself."
 
genomon
Why DateAdd when its days to be added?
 
Remou,

Yeah, the first thing I tried was Now() + 10 and got it to work...

I'm trying to put this in a textbox and have it calculate based on when the report is printed.

As I mentioned, I'd ultimately like it to expire in one hour. DateAdd() appears to need too many pieces of info to work properly.



__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
Rem -
DateAdd("d", 10, Now()) will return a date 10 days in the future.

"Teamwork means never having to take all the blame yourself."
 
You created a textbox and put:

=Now()+10

and it did not work? Any error messages.

I see now why genomon suggested DateAdd, you will need to use it for a time one hour in advance. You may as well start now :)
 
REPEATING:Yeah, the first thing I tried was Now() + 10 and got it to work...

THE GOAL: Show the expiration time one hour from the report publication time.

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
How about DateAdd("h", 1, report publication time) ?

"Teamwork means never having to take all the blame yourself."
 
Ah, and the boss changes his mind yet again...he really wants it to expire in 30 minutes.

(Frustration level is about a 9.8 right now.)

Thanks for any help!!

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
It seems that DateAdd() needs whole numbers to calculate.

I just tried:
=DateAdd("h",.5,Now())
and it showed up with the same time....

bummer

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
You can use minutes - its n as far as I recall.
 
Look at the function in help, please.
How about =DateAdd("n",30, Now())???

"Teamwork means never having to take all the blame yourself."
 
Thank you genomon. My built in help was annihilated when this version of Access was loaded. I'd just done a Google search when I checked your post.

The 'n' was the missing factor.

Thank you again!

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
[cheers]

"Teamwork means never having to take all the blame yourself."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top