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 |
|
Arun.G
Yak Posting Veteran
81 Posts |
Posted - 2010-06-29 : 10:00:26
|
| i have 2 tables:tbl1: calendarcalendar_id calendar_name organization location financialyear1 aaa lts bangalore 20102 bbb lts chennai 20103 ccc lts bangalore 20114 ddd rts bangalore 2010 5 eee rts bangalore 2011tbl2: holidaysholiday_id calendar_id holidays date1 1 new year 01-01-2010 2 1 valentine day 14-02-20103 2 pongal 14-01-20104 3 newyear 01-01-20115 4 may day 01-05-20106 5 deepavali 20-10-2011like thatnow in front end, there isorganization:dropdownlistlocation:dropdownlistyear:dropdownlist3 input fields are there,1) organization is dropdownlist which shows all organization(coming from organization tables), the user will select one organization2)based on selected organization, the location(coming from location table) should be filteredfor example in above sample table, if organization selected =lts means, in location dropdownlist only bangalore and chennai should come in the dropdwon list3) if they selected location: bangalore means,the financial year(coming from year table)only 2010,2011 based on the location only should come in drowdown list4) Based on the organization,location,financial year, the holidays should be displayed like below:organization: ltslocation: bangaloreyear:2010output: holiday date new year 01-01-2010like that result should come?pls help me in query to achieve this or in stored procedure.thanks in advance |
|
|
mohd.taheri
Starting Member
5 Posts |
Posted - 2010-06-30 : 08:48:39
|
| I cant understand it clean but maybe you need a simple join on your two tables on the calendar_id ColumnsSelect * From calendar inner join holidays on calendar.calendar_id = holidays.calendar_id where organization = @organization and location = @location and financialyear = @yearRegards |
 |
|
|
mohd.taheri
Starting Member
5 Posts |
Posted - 2010-06-30 : 08:55:53
|
| I cant understand it clean but maybe you need a simple join on your two tables on the calendar_id ColumnsSelect * From calendar inner join holidays on calendar.calendar_id = holidays.calendar_id where organization = @organization and location = @location and financialyear = @yearRegards |
 |
|
|
|
|
|