Subject | time subtraction problem |
---|---|
Author | martinthrelly |
Post date | 2008-10-08T03:33:10Z |
hello.
i have 2 times stored in the database and i want to subtract them. but
i want to ignore the hundredths of the second.
var_start_time = 16:06:00
var_end_time = 16:10:00
declare variable var_seconds decimal(9,4);
var_seconds = var_end_time - var_start_time;
this is giving me a value of 240.7960 which is because it is taking
the hundredths of a second into account.
what i want to get here is 240 flat.
ive tried casting (rounds up) and am wondering if i need to recreate 2
new time vars based on my originals. any help appreciated thanks
i have 2 times stored in the database and i want to subtract them. but
i want to ignore the hundredths of the second.
var_start_time = 16:06:00
var_end_time = 16:10:00
declare variable var_seconds decimal(9,4);
var_seconds = var_end_time - var_start_time;
this is giving me a value of 240.7960 which is because it is taking
the hundredths of a second into account.
what i want to get here is 240 flat.
ive tried casting (rounds up) and am wondering if i need to recreate 2
new time vars based on my originals. any help appreciated thanks