Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / September 2004



Tip: Looking for answers? Try searching our database.

Easily convert Days in To Years & Months

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rikesh - 29 Sep 2004 17:53 GMT
Hi

Has anyone got an easily formula to convert the number of days to a value
with years and months??

Signature

Rikesh

(VS6-SP5 / SQL2K-SP3A / W2K-SP4)

Ken Halter - 29 Sep 2004 18:02 GMT
> Hi
>
> Has anyone got an easily formula to convert the number of days to a value
> with years and months??

Since both months and years may have a variable number of days, it's
hard to say. If you use the DateAdd method, you can get just about any
info you need (like days or months or years between any 2 dates)

Signature

Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..

Lance Wynn - 29 Sep 2004 18:26 GMT
Hi,
   If you have a number of days, like 734 (versus an actual date) you can
get the years and months
by doing:

years = datediff("yyyy",0,numDays)
months = datediff("m",0,numdays)

It won't be 100% accurate because of leap years, and all, but it should be
pretty close.

Lance

Hi

Has anyone got an easily formula to convert the number of days to a value
with years and months??

Signature

Rikesh

(VS6-SP5 / SQL2K-SP3A / W2K-SP4)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.