Calculated field with no decimals

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

Guest

How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
 
You're correct, I need to round up. Your first example did not round up. Is
there a way to round up and keep it a number? Thanks, Rob

Jerry Whittle said:
Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


RobUCSD said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
RobUCSD said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000


That's a different way of defining " round up" ;-)

If you just want to discard the frctional part of the
number, use the Int or Fix function
Calc QTc: Fix(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)
 
Hi -

See:
http://www.accessmonster.com/Uwe/Forum.aspx/access-modulesdaovba/23644/ALWAYS-ROUND-UP


Bob

Marshall said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
[quoted text clipped - 3 lines]
Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

That's a different way of defining " round up" ;-)

If you just want to discard the frctional part of the
number, use the Int or Fix function
Calc QTc: Fix(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)
 
Use CLng() instead of Int() ...

--
HTH
Van T. Dinh
MVP (Access)




RobUCSD said:
You're correct, I need to round up. Your first example did not round up.
Is
there a way to round up and keep it a number? Thanks, Rob

Jerry Whittle said:
Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


RobUCSD said:
How can I make the output of a calculated field display without
decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the
out put
to round up. I need to see 730 as opposed to 730.742003 for example.
Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
Thanks to everyone. If I understood everyone correctly, there is no way to
round up without writing a funtion. There's no way to tell the caluculated
field to round up via the equation? If this is correct, where would I put the
function? In the form where the query's data is presented?

Thanks for your help. Rob

Marshall Barton said:
RobUCSD said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000


That's a different way of defining " round up" ;-)

If you just want to discard the frctional part of the
number, use the Int or Fix function
Calc QTc: Fix(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)
 
I don't know if you read further up in the thread where I acknowledged my
mistake of writing 730 when I should have written 731. Do you have a solution
to my problem (with the query)?

Marshall Barton said:
RobUCSD said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000


That's a different way of defining " round up" ;-)

If you just want to discard the frctional part of the
number, use the Int or Fix function
Calc QTc: Fix(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)
 
Thank you Van, works perfect. Have a great evening. Good vibes your way.

Rob

Van T. Dinh said:
Use CLng() instead of Int() ...

--
HTH
Van T. Dinh
MVP (Access)




RobUCSD said:
You're correct, I need to round up. Your first example did not round up.
Is
there a way to round up and keep it a number? Thanks, Rob

Jerry Whittle said:
Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

How can I make the output of a calculated field display without
decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the
out put
to round up. I need to see 730 as opposed to 730.742003 for example.
Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
Using CLng will round up and down.

If your number is positive and you always want to round up to the next
higher positive integer use.

-Int(-[YourNumberField])

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Thank you Van, works perfect. Have a great evening. Good vibes your way.

Rob

Van T. Dinh said:
Use CLng() instead of Int() ...

--
HTH
Van T. Dinh
MVP (Access)




RobUCSD said:
You're correct, I need to round up. Your first example did not round up.
Is
there a way to round up and keep it a number? Thanks, Rob

:

Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

How can I make the output of a calculated field display without
decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the
out put
to round up. I need to see 730 as opposed to 730.742003 for example.
Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
John, Thanks for your solution. I do want to round up and down, sop Van's
solution works best for my needs. Thank again, Rob

John Spencer said:
Using CLng will round up and down.

If your number is positive and you always want to round up to the next
higher positive integer use.

-Int(-[YourNumberField])

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Thank you Van, works perfect. Have a great evening. Good vibes your way.

Rob

Van T. Dinh said:
Use CLng() instead of Int() ...

--
HTH
Van T. Dinh
MVP (Access)




You're correct, I need to round up. Your first example did not round up.
Is
there a way to round up and keep it a number? Thanks, Rob

:

Calc QTc: Int(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)

However you said round up which would be 731.

Calc QTc: Format(([fldQT]/1000)/Sqr([fldRR]/1000)*1000),0)

Warning: Format returns a string and not a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

How can I make the output of a calculated field display without
decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the
out put
to round up. I need to see 730 as opposed to 730.742003 for example.
Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000

Thanks, Rob
 
Sure, lots of them. Which one might be the one you want
depends on what you mean by "round up". If you want any
fractional part, regardless of how small, to take it to the
next higher integer, then it's called the Ceiling. John's
expression is a good way to do it.
--
Marsh
MVP [MS Access]

I don't know if you read further up in the thread where I acknowledged my
mistake of writing 730 when I should have written 731. Do you have a solution
to my problem (with the query)?

Marshall Barton said:
RobUCSD said:
How can I make the output of a calculated field display without decimals? The
calcualtion below works to calculate the calculated QT Time which is
cardiology related and I won't bore you with the details. I need the out put
to round up. I need to see 730 as opposed to 730.742003 for example. Any
help would be greatly appreciated.

Calc QTc: ([fldQT]/1000)/Sqr([fldRR]/1000)*1000


That's a different way of defining " round up" ;-)

If you just want to discard the frctional part of the
number, use the Int or Fix function
Calc QTc: Fix(([fldQT]/1000)/Sqr([fldRR]/1000)*1000)
 
Back
Top