devxlogo

Evaluate the number of days remaining in the current year

Evaluate the number of days remaining in the current year

The DatePart() function can return the number of days from the beginning of the current year, but there is no VB built-in function that returns the number of days left to the end of the year. You can work around this with the DateDiff function:

' aDate contains a valid dateDaysToEndOfYear = DateDiff("d", aDate, DateSerial(Year(aDate), 12, 31))

devx-admin

Share the Post: