You can substract the first day of the year from the curranet date
FUNCTION DayOfTheYear(dDate)
SET DATE GERMAN
fday = CTOD("01.01."+STR(YEAR(dDate),4))
RETURN dDate - fDay + 1
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.