Subject Re: [firebird-support] How to do Time calculation
Author Vishal Tiwari
>Next, the result of one particular date/time minus another does not
>result in a date or time, you should know that. It results in a "duration",
>which is stored in a format you would like, eg "integer" (depending on
>how precise you want it).

>Subtracting one "clockdatetime" from another (end-start) gives you the
>duration.
 
 
 
I want to get time period i.e. duration. as per you said, not date or time i.e. total time period for a day
 
Thanks for the efforts.
 
Vishal Tiwari...

--- On Fri, 18/12/09, Martijn Tonies <m.tonies@...> wrote:


From: Martijn Tonies <m.tonies@...>
Subject: Re: [firebird-support] How to do Time calculation
To: firebird-support@yahoogroups.com
Date: Friday, 18 December, 2009, 5:26 PM


 



Hi,

>I have one small question(doubt) that how to subtract time.
>
>Let me explain in detail:
>
>I have one table, say "Test_Data" and I have three fields as follows:
>
>1) EmpNo Varchar(15)
>2) dtDate Date
>3) tmTime Time
>
>This table will contain entry time as well as exit time for a perticual day
>for a perticular employee. Now here i >want to calculate the total time
>employees worked for given two different dates or two same dates, how do i
> >achieve this.

For starters, it would be easier if you store "date and time" in the
same column:

1) empno
2) clockdatetime

Next, the result of one particular date/time minus another does not
result in a date or time, you should know that. It results in a "duration",
which is stored in a format you would like, eg "integer" (depending on
how precise you want it).

Subtracting one "clockdatetime" from another (end-start) gives you the
duration.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.database developmentforum .com









The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

[Non-text portions of this message have been removed]