Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2005

Tip: Looking for answers? Try searching our database.

Time Subtracting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dogpigfish - 16 May 2005 18:10 GMT
I have two long time fields and a query that subtracts the difference.  In
the query I have an additional field for short time.  I want the equation to
subtract the difference between each long time field and subtract out the
short time.  I'm not sure how to do this.  

Basically how do you get a time field to subtract out another time field.  I
am having errors.  Any reason the short time field can't subtract out another
short time field in the query???
Duane Hookom - 16 May 2005 18:38 GMT
Date/time fields are all the same in Access. They may be displayed in
different formats on forms and reports but they are all stored exactly the
same in your tables.

You can treat them like floating point numbers and perform all kinds of
basic math on them. Perhaps if you provided some sample records and desired
display, someone could find what you are doing wrong.

Signature

Duane Hookom
MS Access MVP

>I have two long time fields and a query that subtracts the difference.  In
> the query I have an additional field for short time.  I want the equation
[quoted text clipped - 7 lines]
> another
> short time field in the query???
Ofer - 16 May 2005 19:08 GMT
I would think that the only reason you would like to subtracks to fields is
to get the difference between them, if that the case you should use datediff
function

datediff("n",format(FieldTime1,"hh:mm"),format (FieldTime2,"hh:mm"))

will give you the difference by minutes
if then you want to add that difference to another filed then you should use
the dateadd function

> I have two long time fields and a query that subtracts the difference.  In
> the query I have an additional field for short time.  I want the equation to
[quoted text clipped - 4 lines]
> am having errors.  Any reason the short time field can't subtract out another
> short time field in the query???
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.