Can you post DDL + sample data + sample output?
http://www.aspfaq.com/etiquette.asp?id=5006 --
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic --
[quoted text, click to view] "Dale Palmer" <dale@d-p-d.co.uk> wrote in message
news:%23hfhylrCFHA.4052@TK2MSFTNGP15.phx.gbl...
> I'm having trouble trying to get a Select Statement working, my current
> statement is attached below.
>
> I have two tables: Table one (tblProducts) is product description & Table
> two (tblExtraProd) is a list of ingredients for each product.
>
> I need to be able to select and ingredient that needs to be included and
one
> that needs to be excluded and get a result.
>
> Any help or ideas would be very much appreciated.
>
> Regards
>
> Dale
>
> SELECT seasonedpi.dbo.tblProducts.P_ID,
> seasonedpi.dbo.tblProducts.DISPLAYNAME,
seasonedpi.dbo.tblProducts.Cuisine,
> seasonedpi.dbo.tblProducts.PType,
> seasonedpi.dbo.tblProducts.mild, seasonedpi.dbo.tblProducts.sultry,
> seasonedpi.dbo.tblProducts.spicy,
> seasonedpi.dbo.tblProducts.explosive,
> seasonedpi.dbo.tblProducts.volcanic, seasonedpi.dbo.tblExtraProd.ExProduct
> FROM seasonedpi.dbo.tblProducts RIGHT OUTER JOIN
> seasonedpi.dbo.tblExtraProd ON
> seasonedpi.dbo.tblProducts.P_ID = seasonedpi.dbo.tblExtraProd.ExRelate
> WHERE (seasonedpi.dbo.tblExtraProd.ExProduct <> 30) AND
> (seasonedpi.dbo.tblExtraProd.ExProduct = 135)
>
>