Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

T-SQL 2008 R2 date filter between StartDate and EndDate

$
0
0

Hi I have below SQL 2008 R2 table where user input data for a given account code with date-ranhe i.e. StartDate and EndDate

AccountCode     StartDate       EndDate        Amount
ACC1                2013-12-15    2013-12-27      10.50
ACC1                2014-01-17    2014-02-19      80.95
ACC2                2013-01-21    2013-01-25      78.71
..................
..................

I'd like to design a report with two parameters that users will be passing : StartDate and EndDate

For an example if user pass 2013-12-14 to 2013-12-19 then first row in above sample table should be display. As a second example if user pass from 2013-12-01 to 2014-01-24 then above first and second rows should display. Any T-SQL please?




Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>