>I have a character field containing dates in format "DD-MON-YY", i.e. "12-Jan-03".
>
>Has anyone got an easy answer to indexing this field in date order of year-month-day. Is there a function to convert i.e "Jan" to "01", "Feb" to "02" etc.?
>
>Regards
>
>Jeff
I don't think VFP has such a function built-in, but it is fairly easy to create a UDF, for instance:
function DateNameToNumber(tcMonth)
tcMonth = upper(tcMonth)
do case
case tcMonth = "JAN"
return "01"
case tcMonth = "FEB"
return "02"
...
case tcMonth = "DEC"
return "12"
otherwise
return "00"
endcase
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)