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

Query Question as Well

Status
Not open for further replies.
Apr 25, 2002
156
GB
Hi,

I have the following and just need to have the syntax for a query.

I have a date field with the date of a purchased item and i also want to show the total in Years and months that we have owned the article based on the current date.

where

for example date() - purchase date and then to format the ouput to be in years and months if possible.

so it would show 4yrs and 3 months ..... or something like that

Is this possible ?

regards

Roadrunner
 
Try this
Code:
DateDiff ("m", [Purchase Date], Date() ) \ 12 & " Years, " & 
DateDiff ("m", [Purchase Date], Date() ) Mod 12 & " Months"
 
Hi,

I have pasted that it in and get a #error.....

I guess i am putting that all on one line ....

regards


roadrunner
 
Hard to diagnose. Can we see your complete query SQL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top