Rich,
You can get rid of the loop if you simply subtract Jan 1 from the date and add 1. Subtrarcting two dates will give you the number of days difference.
>The Julian daynumber (I think) is the type of number you were expecting with year plus days-in-year, e.g. - 1999048 for today. I don't think there's a function to return this number within native VFP commands and functions, but it'd be awfully easy to write. Something like:
>
FUNCTION JulDayNum
>LPARAMETER ldDate
>LOCAL lnRetVal, lnMonthNum
>IF TYPE(ldDate) != 'D'
> RETURN 0
>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.lnRetVal