Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ravininave
Posting Yak Master
111 Posts |
Posted - 2010-09-28 : 14:04:55
|
Hi all,I've two fields in my Table like StartDate and EndDate. Actually Member will get paid from StartDate to EndDate. Now I've to query any Date and filter those entries which comes between these two daysSuppose StartDate is '01/01/2010' and EndDate is '20/02/2010' and I've to find if he is eligible to get paid on '15/01/2010' means I've to filter all those records which meets the criteria of my Date.Can anyone suggest me the sql for this problem.VB6/ASP.NET------------------------http://www.nehasoftec.com |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-09-28 : 15:20:43
|
It would be nice to give us the table structure so we can know for example what is the datatype of your column.Then also you can give some example data and the wanted output in relation to the example data. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
ravininave
Posting Yak Master
111 Posts |
Posted - 2010-09-28 : 15:38:55
|
Thanx for replySrNo. StartDate EndDate1 01/01/2010 10/01/20102 08/01/2010 20/01/2010If I search for Date 05/01/2010 then ResultSrNo 1If I search for Date 09/01/2010 then ResultSrNo 12 |
 |
|
jleitao
Posting Yak Master
100 Posts |
Posted - 2010-09-29 : 04:20:15
|
Hi ravininave,SELECT * FROM <TABLE>WHERE '05/01/2010' BETWEEN STARTDATE AND ENDDATE |
 |
|
ravininave
Posting Yak Master
111 Posts |
Posted - 2010-09-29 : 15:04:26
|
Thanx it works. |
 |
|
|
|
|