Hi there,
can anyone help me write a linq query, its a bit confusing... Basically i have a variable which numeberOfDays in my code which for this example is 8
I have a table that lists this.
DayFrom DayTo Price
1 3 20
4 5 30
6 8 40
8 25 150
I need to return from linq a line for every day in my case 8...
so hence i end up with
20 (because day 1 and its from 1 to 3)
20 (because day 2 and its from 1 to 3)
20 (because day 3 and its from 1 to 3)
30 (because day 4 and its from 4 to 5)
30 (because day 5 and its from 4 to 5)
40 (because day 6 and its from 6 to 8)
40 (because day 6 and its from 6 to 8)
40 (because day 7 and its from 6 to 8)
40 (because day 8 and its from 6 to 8)
// no more records will be listed because we are on 8 and its the last day..
SO basically i just need to return a TOTAL of all in this case
20+20+20+30+30+40+40+40+40 = 280 .....
I have no idea where to start,, if it was in code then i could use a counter for numOfDays and a for Next to check the day and the price in within Dayfrom and Dayto..
I would really appreciate any feedback..
Thanks