Days left in a year

M

Mike

Hi,
I'd like to display, in a form, # of days left to year end, using today's
date as a referance.
TIA
Mike
 
D

Douglas J. Steele

DatePart("y", Date) will tell you what day of the year it is.

DatePart("y", DateSerial(Year(Date), 12, 31)) will tell you how may days
there are in the current year.

Therefore, you can use, as a control source for your textbox,

=DatePart("y", DateSerial(Year(Date), 12, 31)) - DatePart("y", Date)
 
R

Rick Brandt

Mike said:
Hi,
I'd like to display, in a form, # of days left to year end, using
today's date as a referance.
TIA
Mike

DateDiff("d", Date(), DateSerial(Year(Date()), 13, 0))
 
J

John Vinson

Hi,
I'd like to display, in a form, # of days left to year end, using today's
date as a referance.
TIA
Mike

Set the Control Source of a textbox to

=DateDiff("d", Date(), DateSerial(Year(Date()) + 1, 1, 1))


John W. Vinson[MVP]
 
Top