Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using "Minutes" in a IIF.....

Status
Not open for further replies.

NewTeki

Technical User
Jul 16, 2003
22
US
Does anyone know of a way to compare the minutes of a time field to a number. For example: I need to compare the minutes of a clocked in Time, if it is > 53 zero out minutes and add 1 to the Hour. If it is between 46 and 53, make it 45. etc. Maybe something like this is too much for Access. Any guidance would be appreciated.

Jim
 
Hallo,

Have you looked at the Minute function in Access Help?

You could write a function that performs the calculation you require using the Minute and DateAdd functions,

- Frink
 
Nothing came up in Help when typing in minute.
 
Hallo,

Oh. I'm using Access '97 and it says this:

-----------------------------------------------------------
Minute Function
Returns a Variant (Integer) specifying a whole number between 0 and 59, inclusive, representing the minute of the hour.

Syntax

Minute(time)

The required time argument is any Variant, numeric expression, string expression, or any combination, that can represent a time. If time contains Null, Null is returned.

-----------------------------------------------------------
Minute Function Example
This example uses the Minute function to obtain the minute of the hour from a specified time. In the development environment, the time literal is displayed in short time format using the locale settings of your code.

Dim MyTime, MyMinute
MyTime = #4:35:17 PM# ' Assign a time.
MyMinute = Minute(MyTime) ' MyMinute contains 35.
-----------------------------------------------------------



Hope that helps, I suppose you could also use Val(Format$(Now(),"n")).


- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top