>iHour = 24 >m.StartingAM = .T. > >REPLACE AppointmentTypeSetsEdit.DisplayTime WITH PADL(AppointmentTypeSetsEdit.Hour, 2, '0') ; > + ':' + '00' + ' ' ; > + IIF(iHour>=12 AND iHour<=24,IIF(m.StartingAM,'PM','AM'),'AM') > >REPLACE AppointmentTypeSetsEdit.DisplayTime WITH PADL(AppointmentTypeSetsEdit.Hour, 2,'0') ; > + ':' + PADL(AppointmentTypeSetsEdit.Minute, 2, '0') + ' ' ; > + IIF(iHour>=12 AND iHour<=24,IIF(m.StartingAM,'PM','AM'),'AM') > >>
SET HOURS TO 12 SET SECONDS OFF for nHour=0 to 23 for nMinute= 0 to 45 step 15 tT=datetime(2008,1,1,nHour, nMinute,0) *-- this'll be the character interpretation of the time as the non-ANSI standard has it: insert into ... value (... RIGHT(tT),8)) endfor endfor[update] This is how VFP's automatic display handles it, and for some reason it thinks the time between midnight and 0:59 is actually 12:00 AM to 12:59 AM. If you're fine with that, OK, if you need it to be 0:00, 0:15, 0:30, 0:45, you may need to loop from 1 to 23, not from 0 to 23, and handle this one hour manually.