954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Get a list based on start date and end date by giving monthid as parameter

Hai ,
I have 2 tables

1. Transport_Details having columns
user_id
FareStageId
StartDate
EndDate


and
2. Route_Fee having columns
FareStageId
monthId
fees

I need to get a monthwise list by passing monthid.
But my problem is that , if start date and enddate of a user are 02-08-2011 and
20-02-2012 and I need to get the list of 4th month , this user also listed.

Query I used is:

select Transport_Details.User_Id, Route_Fee.Fee, from Transport_Details join Route_Fee
on Transport_Details.Bus_Route_Fare_Stage_Id=Route_Fee.Bus_Route_Fare_Stage_Id where Route_Fee.Month=4


Can i get the list of those users , the monthid between startdate and enddate.

Thanks in advance.

ssreevidya.m
Junior Poster in Training
51 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

I have replied your previous thread, you may check it whether it is helping u or not.

http://www.daniweb.com/web-development/databases/ms-sql/threads/389707/1684223#post1684223

urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: