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

Date Difference 7

Status
Not open for further replies.

rtoguchi

Technical User
Jan 13, 2004
9
US
In Excell, I would like to create a formula that shows the difference between two dates. I know how to do this for an Access query, but not in Excell. I would want the put the equation in the "Days until Due" column."

Due Date Today's Date Days until Due
5/20/04 5/19/04 1
5/10/04 5/19/04 -9

Would I also be able to make the "-9" highlight in red as well?
 
So if you don't put any criteria, and just run the query, it runs fine and displays the correct Age and the correct range, but when you add something to the Age criteria cell it prompts you for the Age?

If this is the case perhaps you could post exactly what you have for each cell in the query design grid. What do you have in the field cell, the table cell, the sort cell, etc.

Good luck



-Gary
 
OK:

AGE
FIELD: Age: DateDiff("yyyy",[DOB],Date())+(Date()<DateSerial(Year(Date()),Month([DOB]),Day([DOB])))
TABLE: nothing
SORT: nothing
CRITERIA: nothing

AGE GROUP
FIELD: Age Group: IIf([age]<3,"0 - 2",IIf([Age]>=3 And [Age]<=5,"3 - 5",IIf([age]>5 And [age]<12,"6 - 11","12 - Adult")))
TABLE: nothing
SORT: nothing
CRITERIA: nothing

If I put a formula in the AGE criteria I get a data type mismatch in criteria expression error and all the data in the fields get replaced with #Name?. Talk about freakin' me out! [surprise]

If I put the formula in the AGE GROUP criteria I get the enter parameter window and it has the field AGE in the corner of it. Not sure what it's asking for but if I just hit OK I get the expression is typed incorrectly error.
 
Hi Gary,

Hadn't heard from you in a while and was wondering if you had a chance to look at this.

Thanks,

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top