FUNCTION JulDayNum >>LPARAMETER ldDate >>LOCAL lnRetVal, lnMonthNum >>IF TYPE(ldDate) != 'D' && May also want to accept D/T >> RETURN 0 && zero >>ENDIF >>lnRetVal = YEAR(m.ldDate)*1000 >>FOR lnMonthNum = 1 TO MONTH(m.ldDate) - 1 >> * Add number of days for each month from an array >>ENDFOR >>lnRetVal = m.lnRetVal + DAY(m.ldDate) >>RETURN m.lnRetValI knew there was a simpler way, but I couldn't think of it off the top of my head. I've often used Date - DAY(Date) + 1 to get the first of a month. I know how date math works, pretty much. Just had a little brain lapse there.