Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation between 2 cells in another cell

Status
Not open for further replies.

TanTrazz

Programmer
Aug 18, 2001
54
NL
Hi there

I've made a SQL database in ASP.net

I've got 2 cells : Begin_Time and End_Time.
Now i have another cell : Total_Time.

Now i want to fill the Total_Time cell with the Begin and End_Time.

So the Begin_time cell minus the End_Time cell = Total_Time Cell

How can i do this????

Tnx TanTrazz
 
I would think you would want End_Time - Start_Time, being that End_Time would be a higher value... But in your example, you would do something like this:
Code:
Total_Time = Begin_time.Subtract(End_Time)
All variables would be DateTime values. If you wanted to know the difference in time, switch the End and Start time. (If End_Time is truly later that Start an exception might be thrown. I don't believe you can calculate to negative time.)

For more info check this MSDN out:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top