current day is day # of this year

wh00t

Registered User.
Local time
Today, 23:20
Joined
May 18, 2001
Messages
264
greetings all

I need to obtain the day number for a database I'm working on i.e. today is the 42nd day of this year, I do recall seeing something to get this, but I can't remember it now :/

any help would be appreciated
 
DatePart("y",Date)
will get you 42.
 
Pointless function. :p

Code:
Public Function DayOfYear(ByVal dteTemp As Date) As Integer
    On Error GoTo Err_DayOfYear
    DayOfYear = DateDiff("d", DateSerial(Year(dteTemp), 1, 0), dteTemp)
Exit_DayOfYear:
    Exit Function
Err_DayOfYear:
    MsgBox Err.Description, vbExclamation, "Error #" & Err.Number
    Resume Exit_DayOfYear
End Function
 

Users who are viewing this thread

Back
Top Bottom