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

I need some help with a date query

Status
Not open for further replies.

tamer64

IS-IT--Management
Aug 27, 2007
120
US
My employees are due evaluaions 60 days from the hire date. My query below shows me this:

HireDate Overdue
01/25/2010 61 days over due

But I need to show it like this:

HireDate Overdue
01/25/2010 1 days over due

What do I need to do to make this work?

[blue]Overdue: IIf([HireDate]+60<Date(),Int(Date()-[HireDate]) & ' days over due','')[/blue]
 
Code:
IIf([HireDate]+60<Date(),Date()-[HireDate]-60 & " days over due","")

Ed Metcalfe.

Please do not feed the trolls.....
 
I would rarely do this in an expression in a query. IMO don't hard-code the 60 since it may change. Either put the 60 in a table where you can reference it in your query or create a small public function in a module named "modBusinessRules".

Duane
Hook'D on Access
MS Access MVP
 
Thank you both and dhookom, you make a very good point..I will make a seperate table as you suggested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top