I have a record with a datetime field and a numeric priority field. I want to find the record with the highest priority and within priority, the earliest datetime.
In languages where date and times are numeric fields I can do indexfield=STR(priority,3,0)+STR((99999999-date),8,0)+STR((999999-time),6,0) to get what I want.
In VFP I have to use an even kludgier indexfield=STR(priority,3,0)+STR({^9999/12/31,11:59:59pm}-datetime),?,0).
1. How big should the second STR field be?
2. Can anyone think of an easier way around this?
In languages where date and times are numeric fields I can do indexfield=STR(priority,3,0)+STR((99999999-date),8,0)+STR((999999-time),6,0) to get what I want.
In VFP I have to use an even kludgier indexfield=STR(priority,3,0)+STR({^9999/12/31,11:59:59pm}-datetime),?,0).
1. How big should the second STR field be?
2. Can anyone think of an easier way around this?