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!

Change days into months using a formula 1

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
Hello,
I'm trying to take this formula and show 30 day months. any thoughts?

datetimevar d1:={SAMPLE.DATE3};
datetimevar d2:={SAMPLE.DATE1};
totext(Datediff("n",d2,d1)/60 /24,0,"") & " days"



Thanks

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Try this:

datetimevar d1:={SAMPLE.DATE3};
datetimevar d2:={SAMPLE.DATE1};
totext(Datediff("n",d2,d1)/60/24/30,1,"") & " months"

I would use a decimal (1 in this case) to get a better estimate.

-LB
 
Thank you, it works great

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top