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.

round seconds

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dogpigfish - 19 May 2005 18:04 GMT
I have a long time field, however for my calculations to work in later fields
I need it to round down from seconds.  I have a time for 12:04:29, the field
will only show "12:04", but I want it to permanently be "12:04" so that
calculations later to value 0:00 instead of 0:00:29.  I am left with a time
balance.  The problem is that when I have large amounts of time data there
may be 2 or 3 minutes added to the equation because it is taking seconds into
consideration.  I want to eliminate this.  
Ofer - 19 May 2005 19:24 GMT
you can use the format function
e.g format("11:12:34","hh:mm") will return 11:12
or format("11:12:34","short time")
you can change the field permanently by updating the table with update query

UPDATE MyTable SET TimeField= Format([TimeField],"Short Time")

or change the property of the field to short time.

> I have a long time field, however for my calculations to work in later fields
> I need it to round down from seconds.  I have a time for 12:04:29, the field
[quoted text clipped - 3 lines]
> may be 2 or 3 minutes added to the equation because it is taking seconds into
> consideration.  I want to eliminate this.  
dogpigfish - 19 May 2005 19:44 GMT
The problem I am facing is, even if it returns that format, it still keeps
the seconds back in the memory of the program.  When I calculate reports, it
doesn't exactly round.  The seconds are permanent in the program.  Anyway to
maybe copy and paste just the value and not the permanent number or is there
a rounding function that can round the seconds permanently.  

> you can use the format function
> e.g format("11:12:34","hh:mm") will return 11:12
[quoted text clipped - 12 lines]
> > may be 2 or 3 minutes added to the equation because it is taking seconds into
> > consideration.  I want to eliminate this.  
Ofer - 19 May 2005 20:31 GMT
that what I said to run an update query on the table a update the time fields
to round one, check the previous post.
That way the data will be stored in the table rounded.

> The problem I am facing is, even if it returns that format, it still keeps
> the seconds back in the memory of the program.  When I calculate reports, it
[quoted text clipped - 18 lines]
> > > may be 2 or 3 minutes added to the equation because it is taking seconds into
> > > consideration.  I want to eliminate this.  
John Spencer (MVP) - 20 May 2005 00:59 GMT
UNTESTED IDEA:

UPDATE TheTable
SET TheTimeField = DateAdd("s",-DatePart("s",TheTimeField),TheTimeField)
WHERE TheTimeField is Not Null

> I have a long time field, however for my calculations to work in later fields
> I need it to round down from seconds.  I have a time for 12:04:29, the field
[quoted text clipped - 3 lines]
> may be 2 or 3 minutes added to the equation because it is taking seconds into
> consideration.  I want to eliminate this.
 
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.