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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding 1

Status
Not open for further replies.

hollyann

Technical User
Apr 12, 2000
15
US
Really need help!  This must be a tough one because I cannot get the answer anywhere.  I need 8 expressions in a query to round to the nearest 50 cents.
 
hollyann,<br>You need to be a little more specific...but as a general answer, if you have a field,AMT.&nbsp;&nbsp;Put this in a query expression field:<br>Rounded: Int([AMT])+Switch([AMT]-Int([AMT]) Between 0 And 0.24,0,[AMT]-Int([AMT]) Between 0.25 And 0.74,0.5,[AMT]-Int([AMT]) Between 0.75 And 0.99,1)<br><br>This assumes that if the amount is 1.26, you want 1.50, 1.24=1.00, 1.74=1.50, 1.75 = 2.00 etc.<br>--Jim
 
Thank you so much!!&nbsp;&nbsp;That is exactly what I needed and it works perfect.&nbsp;&nbsp;I wish I had gotten on this forum and asked this question about 2 weeks ago- it would have saved me many headaches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top