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!

Roundup in a Query

Status
Not open for further replies.

jpro

MIS
Mar 8, 2002
21
US
I need to run a query that will show a calculation of pallet requirements that needs to be rounded up regardless of the decimal value - (Ex. 1.2 needs to = 2 pallets). My result is calculated by the division of 2 table values:
Pallet req: [total req]/[unit count]

Is there a criteria or something (aside from any VB which I do not have knowledge of) that can accomplish this?


THX
 
Not sure if there's an easier way or not, but this is the first thing that came to mind:

Pallet req: iif([total req]/[unit count])-INT([total req]/[unit count])>0, INT([total req]/[unit count])+1, ([total req]/[unit count]))

Kind of round about, but I think that should work, hope that helps.

Kevin
 
PalletReq: Int([total req]/[unit count])+Sgn([total req]/[unit count]-Int([total req]/[unit count])

should do the trick.

Regards,
Dan
 
Thank you very much, It worked Great!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top