What does the raw data look like? If your date string is YYYYMMDD and the time is HHMMSS then the following will work:
stringvar tme:=totext({time.field},0,""

;stringvar dte:=totext({date.field},0,""

;datevar dat;timevar tim;
dat:=date(val(dte [1 to 4]),val(dte[5 to 6]),val(dte[7 to 8]));
if {time.field} in 0 to 99999 then
tim:=time(val(tme[1]),
val(tme[2 to 3]),
val(tme[4 to 5])) else
tim:=time(val(tme[1 to 2]),
val(tme[3 to 4]),
val(tme[5 to 6]));
datetime(year(dat),month(dat),day(dat),hour(tim),minute(tim),second(tim)) Mike