Calculated Fields

liam_conor

Board Regular
Joined
Oct 9, 2002
Messages
180
I have three fields on a subform: "Start Time" "End Time" "Minutes Lost". What I am trying to do is subtract "Start Time" from "End Time" and return the value of total minutes lost to the field "Minutes Lost". Here is the problem: I can subtract "Start Time" from "End Time" but I cannot get a number. Example: 12:00 - 15:00 = 3:00 instead of the number I want 180. The second thing is I cannot get the textbox "Minutes Lost" on the subform that is carrying out the calculation to store that value in the table field "Minutes Lost". This could be due to the fact that I am carrying out the calculation in the Control Source for the textbox on the subform. Any ideas or suggestions...

PLEASE HELP :ROFLMAO:
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi Liam,

try MinutesLost: ([EndTime]-[StartTime])*24*60. A question: do you really need to store the Minutes Lost? If it's a calculation (which it is), you're best off leaving it as a query field and using the query for reporting. Otherwise, subsequent changes to the Start or End time will result in errors in your data.

Denis
 
Upvote 0
Why not use the DateDiff function?

eg DateDiff("n", [EndTime]-[StartTime])
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,913
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top