VENKAT
asked on
Comparing my Table Date, Time fields with System Date&Time.
My Dbase Table have fields 'ST_TIME' Character (10) for Time and 'ST_DATE' Date(8) field for Date. I am using these field to save System Input Time and Date from my application.
I have a calculation in my logic to compare this table 'ST_DATE, 'ST_TIME' with the system present Date&Time. If the difference is more than 48 hours I have some logic to do(like closing the record).
So how can I compare that table 'ST_DATE', 'ST_TIME' with system present Date&Time to find 48 hours difference.
My Table is saving time like :- 11:56:32PM
date like :- 25/07/2002
Please help me to calculate/compare 48 hours time difference. For ex.if do
(Table.FieldByName('ST_TIM E').AsStin g - TimetoStr(Time)).
I am getting errors. Please tell me the way to do this.
I have a calculation in my logic to compare this table 'ST_DATE, 'ST_TIME' with the system present Date&Time. If the difference is more than 48 hours I have some logic to do(like closing the record).
So how can I compare that table 'ST_DATE', 'ST_TIME' with system present Date&Time to find 48 hours difference.
My Table is saving time like :- 11:56:32PM
date like :- 25/07/2002
Please help me to calculate/compare 48 hours time difference. For ex.if do
(Table.FieldByName('ST_TIM
I am getting errors. Please tell me the way to do this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
but attention
your apptimeformat or systemtimeformat and
your appdateformat or systemdateformat
must be set to your format
your apptimeformat or systemtimeformat and
your appdateformat or systemdateformat
must be set to your format
ASKER
hi kretzschmar
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
ASKER
hi kretzschmar
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
now() gives you the current-datetime,
see above, the if statement does all for you
one day is represented by 1
meikl ;-)
see above, the if statement does all for you
one day is represented by 1
meikl ;-)
ASKER
hi kretzschmar
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
thank u. But How can I check with my Date and Time both with present Date and Time to get 48 hours difference.
ASKER
sorry I think my page was refresh..i will check first.
ASKER
I used like this...my ST_DATE is date field which have date like 25/07/2002.
if now - (
Trunc(TimeTable.FieldByNam e('ST_DATE ').AsDateT ime)+
Frac(strtotime(TimeTable.F ieldByName ('ST_TIME' ).AsString ))
) > 2 then
...Now I am getting error like 25/07/2002 is not valid DateTime.
if now - (
Trunc(TimeTable.FieldByNam
Frac(strtotime(TimeTable.F
) > 2 then
...Now I am getting error like 25/07/2002 is not valid DateTime.
well,
your system-shortdateformat seems
to be other than dd/mm/yyyy
at appstart (for ex. in the create-event of your mainform)
set the dateformat appwide with
shortdateformat := 'dd/mm/yyyy';
dateseparator := '/';
meikl ;-)
your system-shortdateformat seems
to be other than dd/mm/yyyy
at appstart (for ex. in the create-event of your mainform)
set the dateformat appwide with
shortdateformat := 'dd/mm/yyyy';
dateseparator := '/';
meikl ;-)
ASKER
thank u..success.
if time-strtotime(Table.Field
but attention
your apptimeformat or systemtimeformat must
be set to this format
11:56:32PM
meikl ;-)