Determine a date by a number

BigJimSlade

Registered User.
Local time
Today, 21:21
Joined
Oct 11, 2000
Messages
173
Hello, Big Jim here,

Say I had the number 45. Is there anyway for me to have VB set that as a date on a 1-365 day scale? In other words, 45 would be February 14th.

Thanks in advance,

Big Jim
 
You didn't day what year. Add the number to a base date i.e., assuming your calculation is correct Basedate(1/1/01) plus YourNumber (45) = 2/14/01 (per your example).
 
at first glance, Dateadd would seem to be the solution, but if you're looking to do calculations on dates for no specific year, you would need to be a bit careful, and do you want to assume that it's a leap year, or not? (not relevant in your example, which returns a date in Feb, but for 65 days, it would be relevant)

the expression:

DateAdd("d",([45]-1),"01/01/00")

returns 14/02/00, from which you could then format to whatever you like in a string and get rid of the year digits.

HTH

Mike

[This message has been edited by Mike Gurman (edited 04-06-2001).]
 
Thank you to both of you. You have been a great help.


Big Jim
 

Users who are viewing this thread

Back
Top Bottom