round seconds

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
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.

Ofer said:
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.

dogpigfish said:
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.
 
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.

dogpigfish said:
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.

Ofer said:
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.

dogpigfish said:
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.
 
UNTESTED IDEA:

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