Lets say today's date is Jan 22, 2014 and i run a report having this table below (Table) but input range of SIdate from Jan 01, 2014 to Jan 18, 2014 only.
I want to display all rows based on the SIdate i entered which is jan 01,2014 to Jan 18, 2014 but CMdate should be considered also and should pass the date parameter.
As you've noticed in Table 2 (My desired output), the 6th row is not there anymore bcore CMdate is Jan 21, 2014
Table 1
Emp SIDate item TotQty TotAmt CMDate CMAmt
-------------------------------------------------------
CLO 01-01-14 item1 120 1500.00 null null
CLO 01-02-14 item2 80 500.00 01-05-14 20.00
CLO 01-05-14 item6 21 1100.00 null null
CLO 01-10-14 item5 100 2000.00 01-10-14 200.00
CLO 01-12-14 item9 300 100.00 null null
CLO 01-16-14 item3 150 650.00 01-21-14 150.00
Table 2 (desired output)
Emp SIDate item TotQty TotAmt CMDate CMAmt
-------------------------------------------------------
CLO 01-01-14 item1 120 1500.00 null null
CLO 01-02-14 item2 80 500.00 01-05-14 20.00
CLO 01-05-14 item6 21 1100.00 null null
CLO 01-10-14 item5 100 2000.00 01-10-14 200.00
CLO 01-12-14 item9 300 100.00 null null
Any input would be very much appreciated.