#ERROR when subtracting 2 times

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hello
I am working in MS Access 16 on the query grid I have 2 time fields LastOfTime Out and FirstOfTime In I want to create a Time Spent field by subtract the 2 times

Time Spent: [LastOfTime Out] - [FirstOfTime In] Would be like this 4:07:00 PM-8:05:00 AM I get #Error

Thanks
L
 
Yes you are correct was trying to remove time from date. The first field date and time is not text.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
OK, it shouldn't really be necessary to remove the date piece then, so I don't think you need to use the TimeValue function (as long as you are subtracting the fields from your original table, and not from some calculated field that you created that may have converted it to Text).
 
Upvote 0
I was using a calculated field but let me try it with the date and time field. Will post back
Thanks you so much for your time. I helps just to talk it out

L
 
Upvote 0
You are welcome.

If you have still have issues, or determine for some reason you need to do it on the calculated fields, post those calculations and we can see if we can change it to return date/time instead of text.
Or, just include any carry the original fields through the queries. There isn't a reason why you cannot have both (the calculated and the original), and just drop the one you don't need from your query results.
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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