L Les Jul 12, 2004 #1 In a table or query, is there a way I can force it to always round UP to the nearest whole number (1.1 would round up to 2)?
In a table or query, is there a way I can force it to always round UP to the nearest whole number (1.1 would round up to 2)?
J Jeff Boyce Jul 12, 2004 #2 Les First, I'd suggest a query for this, as changing 1.1 to 2 loses some information. One way to do this in a query would be to find the integer value, then add one. Check on the CInt() function in Access HELP.
Les First, I'd suggest a query for this, as changing 1.1 to 2 loses some information. One way to do this in a query would be to find the integer value, then add one. Check on the CInt() function in Access HELP.
S Steve Schapel Jul 13, 2004 #3 .... unless the value is already an integer ;-) Could be something like... RoundedUp: Int([MyField])+IIf([MyField]>Int([MyField]),1,0)
.... unless the value is already an integer ;-) Could be something like... RoundedUp: Int([MyField])+IIf([MyField]>Int([MyField]),1,0)
K Ken Snell Jul 13, 2004 #5 Or, if it's always a positive integer: Int(-TheNumber) Or, to catch both positive and negative: IIf(TheNumber>0, Int(-TheNumber), CInt(TheNumber))
Or, if it's always a positive integer: Int(-TheNumber) Or, to catch both positive and negative: IIf(TheNumber>0, Int(-TheNumber), CInt(TheNumber))
S Steve Schapel Jul 13, 2004 #6 Ken, I could agree if you put another - in there... -Int(-[TheNumber]) Man, I just gotta watch you and Jeff like a hawk! <g>
Ken, I could agree if you put another - in there... -Int(-[TheNumber]) Man, I just gotta watch you and Jeff like a hawk! <g>
K Ken Snell Jul 13, 2004 #7 A - here, a - there...... yep! Thanks! -- Ken Snell <MS ACCESS MVP> Steve Schapel said: Ken, I could agree if you put another - in there... -Int(-[TheNumber]) Man, I just gotta watch you and Jeff like a hawk! <g> -- Steve Schapel, Microsoft Access MVP Ken said: Or, if it's always a positive integer: Int(-TheNumber) Or, to catch both positive and negative: IIf(TheNumber>0, Int(-TheNumber), CInt(TheNumber)) Click to expand... Click to expand...
A - here, a - there...... yep! Thanks! -- Ken Snell <MS ACCESS MVP> Steve Schapel said: Ken, I could agree if you put another - in there... -Int(-[TheNumber]) Man, I just gotta watch you and Jeff like a hawk! <g> -- Steve Schapel, Microsoft Access MVP Ken said: Or, if it's always a positive integer: Int(-TheNumber) Or, to catch both positive and negative: IIf(TheNumber>0, Int(-TheNumber), CInt(TheNumber)) Click to expand... Click to expand...