S Sudha Registered User. Local time Today, 17:23 Joined May 1, 2001 Messages 29 Mar 6, 2009 #1 Hi, How do I round values to the next multiple of 5, but if the value is a multiple of 5 then it should return the same value.
Hi, How do I round values to the next multiple of 5, but if the value is a multiple of 5 then it should return the same value.
MSAccessRookie AWF VIP Local time Today, 12:23 Joined May 2, 2008 Messages 3,423 Mar 6, 2009 #2 Sudha said: Hi, How do I round values to the next multiple of 5, but if the value is a multiple of 5 then it should return the same value. Click to expand... Using an IIf Statement can do this. Something like: Code: SELECT IIf ([value]/5=int([value]/5), [value], (int([value]/5)+1)*5) from YourTable;
Sudha said: Hi, How do I round values to the next multiple of 5, but if the value is a multiple of 5 then it should return the same value. Click to expand... Using an IIf Statement can do this. Something like: Code: SELECT IIf ([value]/5=int([value]/5), [value], (int([value]/5)+1)*5) from YourTable;
B ByteMyzer AWF VIP Local time Today, 09:23 Joined May 3, 2004 Messages 1,408 Mar 6, 2009 #3 Another way would be a non-conditional expression, like the following: SELECT Int( MyTable.MyValueField / -5 ) * -5 FROM MyTable;
Another way would be a non-conditional expression, like the following: SELECT Int( MyTable.MyValueField / -5 ) * -5 FROM MyTable;