i know this is a simple thing, but can not figure out how to get it right.. so please help
i have two fields in an acces DB, starttime, and endtime with short time format, in which they blong to the same date. I do some routines on these values and goes fine untill i try to substract them..I want to get the total difference hours between them and put in in a float variable.
This is my code:
TTime total = 0;
//first read the fields as DateTime
TDateTime start_time = datamodule1->Query1->FieldByName("StartTime"->AsDateTime;
TDateTime end_time = datamodule1->Query1->FieldByName("EndTime"->AsDateTime;
//Then substract
total = (act_start_time - act_end_time);
now "total" is a Time variable, and i want to add it's value to another float some where else, and manipulate it further so how can i convert it and get a value like xx.xx? i know you can convert datetime to float, but i only want the time, and not dates since starttime and endtime already have the same date in the db. I hope it is clear, thanks.
i have two fields in an acces DB, starttime, and endtime with short time format, in which they blong to the same date. I do some routines on these values and goes fine untill i try to substract them..I want to get the total difference hours between them and put in in a float variable.
This is my code:
TTime total = 0;
//first read the fields as DateTime
TDateTime start_time = datamodule1->Query1->FieldByName("StartTime"->AsDateTime;
TDateTime end_time = datamodule1->Query1->FieldByName("EndTime"->AsDateTime;
//Then substract
total = (act_start_time - act_end_time);
now "total" is a Time variable, and i want to add it's value to another float some where else, and manipulate it further so how can i convert it and get a value like xx.xx? i know you can convert datetime to float, but i only want the time, and not dates since starttime and endtime already have the same date in the db. I hope it is clear, thanks.