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

Help please Having trouble comparing dates in Access 1

Status
Not open for further replies.

RichardPrewitt

IS-IT--Management
Apr 16, 2002
57
0
0
US
Im writing reports in access that are printed from a VB program. Now on one of the reports they want me to take the last completed date which in a field in each record and compare it to today's date to get a "how long has it been since this task was completed last" field on the report. I was wanting to know if I could just code it into Access report or do I have to add another field in the database and code it into VB to generate the field every time they enter a task?

I was in the code of the detail of the access report that I want this done on and made a label box on the report and called it lblLast I then typed in lblLast. and got no usable values to replace the caption of the label with what I want to show up on the report.

Any help would be appreciated :)

- Richarde
 
I would suggest making it part of the report. Unfortunalty I haven't worked closely with Access reports for years. As a result I am of little help to you. You may be best to ask in the Access reports forum, forum703.

zemp
 
Richard,

You can handle the DateDiff calculation through the report's underlying SQL statement. Set up an alias field "Diff" similiar to the following format.

Diff: DATEDIFF ("y", Date(), [DateCompleted])

Then pass the results to the appropriate control in your report.

Cheers,
Bill
 
Thanks Bill,

Looks like this is going to do the trick :)

Thanks to all for making this learning experience that much better.

- Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top