Hi all,
I am writing a script and when I try to import the script into my database it is giving out about the length of my code.
I need to shorten my code can anybody help shorten it.
The code rounds a figure to the nearest multiple of a supplied number
e.g.
If 3 is entered the result is 5
If 9 is entered the result is 10
If 12 is entered the result is 10
This is my code if anybody can help me shorten it i'd really appreciate it
Code
select case when mod(to_number(aavalue.valuestring),5) = 0 THEN to_number(aavalue.valuestring) when mod(to_number(aavalue.valuestring),5) < 3 THEN to_number(aavalue.valuestring) - mod(to_number(aavalue.valuestring),5) Else to_number(aavalue.valuestring)+( 5- mod(to_number(aavalue.valuestring),5) ) End from
I hope you can help,
Thanks in advance.
AM