| Author |
Topic |
|
nobby
Yak Posting Veteran
58 Posts |
Posted - 2006-10-20 : 03:01:08
|
| I'm Probably doing this all wrong so any guidance will be appreciated.The Top select is filtered by the @MemberId parameterI then want to filter the bottom select using the result of the first oneTourTypeId <> Tbl_01035_Tour_Players.TourTypeId@MemberId int ASBEGIN SET NOCOUNT ON; SELECT MemberId, TourTypeId, TourStartDate, Paid FROM Tbl_01035_Tour_Players WHERE (MemberId = @MemberId) SELECT TourTypeId, TourGame, TourDescr, TourDaysDur, TourMinPot, TourRecurring, TourRecurringBillDur, TourRecurringBillAmount_EnterNow, ToursPerBilling_EnterNow, TourRecurringBillAmount, ToursPerBilling, TourFinished, TourAdminViewOnly, Settings_01, Settings_02, Settings_03, Settings_04, Settings_05, Settings_06, Settings_07, Settings_08, Settings_09, Settings_10 FROM Tbl_01020_Tour_Types WHERE (TourAdminViewOnly = 0) AND (TourFinished = 0) AND (TourRecurring = 1) AND (TourStartDate <= GETDATE()) and (TourTypeId <> Tbl_01035_Tour_Players.TourTypeId)END |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-10-20 : 04:25:01
|
| [code]SELECT TourTypeId, TourGame, TourDescr, TourDaysDur, TourMinPot, TourRecurring, TourRecurringBillDur, TourRecurringBillAmount_EnterNow, ToursPerBilling_EnterNow, TourRecurringBillAmount, ToursPerBilling, TourFinished, TourAdminViewOnly, Settings_01, Settings_02, Settings_03, Settings_04, Settings_05, Settings_06, Settings_07, Settings_08, Settings_09, Settings_10FROM Tbl_01020_Tour_TypesWHERE TourAdminViewOnly = 0 AND TourFinished = 0 AND TourRecurring = 1 AND TourStartDate <= GETDATE() and TourTypeId not in (select top 1 TourTypeId from Tbl_01035_Tour_Players where MemberId = @MemberId)[/code]Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
nobby
Yak Posting Veteran
58 Posts |
Posted - 2006-10-20 : 07:15:31
|
| HarshThanks for that all worked fine except had to remove the top 1 bitThanxs |
 |
|
|
|
|
|