>I subtract the following 2 times to get a time interval which works except when midnight rolls around and my Timea becomes less than my Timeb so Timec ends up negative.
>
>timea - timeb = timec
>
>Timea Char 8 For example hh:mm:ss
>Timeb Char 8 For example hh:mm:ss
>Timec Char 8 For example hh:mm:ss
>
>For example:
>14:30:00 - 13:15:00 = 01:15:00 or 1 hour and 15 minutes
>
>But what if Timea is after midnight?
>01:30:00 - 23:15:00 = 01:45:00 or 1 hour and 45 minutes
>
>Is there a nice and easy calculation for this? I convert the Chars to Values and multiply by each to get everything into seconds and then do my subtractions, but midnight messes up my calculations. Any ideas would be appreciated. Thanks for the help.
Just make them DATETIME data types; the result of subtracting two datetimes is the difference in seconds.