Last post Nov 02, 2017 10:54 AM by gani7787
Nov 01, 2017 08:46 AM|gani7787|LINK
How to find adjust and round value from given range in another table.
I have below values.
 SUB A=140
 SUB C=60
The above values needs to be check in the below TABLE B.
let us consider SUB A=140
First we need to find the columns in TABLE A along with Dept=A3 rows (A3 is parameter which we need to pass finding column along with this)
My objective is find the range in table and adjust the value near to this based on my range.
My SUB A=140
my selected range is "100"
So the Final result is nearest value of SUB A=200 (it means it will consider the range is 100 200,300,etc)
If SUB B=220 then final value is SUB A=300
For Second one,
SUB C=60 ==> Final value is SUB C=75 (the range statrts from 25,50,75,etc)
How to write a code in C# or LINQ in C#..?
Nov 02, 2017 02:59 AM|Billy Liu|LINK
static void Main(string args)
int SubA = 120;
int SubB = 65;
int RoundA = 100;
int RoundB = 25;
static int GetRound(int Sub, int Round)
int value = ((Sub / Round)+1)*Round;
Nov 02, 2017 10:54 AM|gani7787|LINK