By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,484 Members | 1,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,484 IT Pros & Developers. It's quick & easy.

Alem

P: 38
Hi all
happy new year!

plz help me I converted date function in to number of days now mydiffeculty is conver into year if possible including months. like 2.4 that means 2 year and 4 months.

Thank you in advance
Dec 28 '06 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,597
Hi all
happy new year!

plz help me I converted date function in to number of days now mydiffeculty is conver into year if possible including months. like 2.4 that means 2 year and 4 months.

Thank you in advance
'Assuming that the Decimal component indicates 10ths of a year, namely
'2 Years + .4 Years then thios will yield the proper result:

Dim sngNoOfYears As Single
sngNoOfYears = 2.4

Expand|Select|Wrap|Line Numbers
  1. Debug.print sngNoOfYears & " = " & Fix(sngNoOfYears) & " Year(s) and " & Int((sngNoOfYears - Fix(sngNoOfYears)) * 12) & " Month(s)"
Yields: 2.4 = 2 Year(s) and 4 Month(s)
Dec 28 '06 #2

NeoPa
Expert Mod 15k+
P: 31,186
Hi all
happy new year!

plz help me I converted date function in to number of days now mydiffeculty is conver into year if possible including months. like 2.4 that means 2 year and 4 months.

Thank you in advance
If you really mean 2.4 represents 2 Years and 4 Months then you will need to explain better what your 'rules' are. 2.4 ==> 2Yrs & 4Mths is not any natural mapping.
Dec 30 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.