Hi All,

I've continued this thread since my new question is about the same issue,
and about SQL code again.

I've got this query

Select * from typelookup
WHERE (TypeIDFK = 1 AND Type IN (3,4))
AND (TypeIDFK = 2 AND Type IN (1,5))
AND (TypeIDFK = 3 AND Type IN (3,4))
AND (TypeIDFK = 4 AND Type IN (1,4))
AND (TypeIDFK = 5 AND Type IN (3,4))

Which returns nothing, I'm not of the SQL syntax to accomplish what I want.
Basically if I break down each of the (TypeIDFK = 5 AND Type IN (3,4)) bits
into a seperate query i get a result set of several rows. There's at least
one item that meets each of the where clauses and is in each result set. Is
there a way to combine all those into ( a working version) of the above
query?

Thanks all

J

On 12/15/05, John Wilker <[EMAIL PROTECTED]> wrote:
>
> Ian and Deanna
>
> you guy's approach makes sense. Grouping should get me to the last
> stretch.
>
> Aaron, I'm sure a quick and dirty MSSQL function would work if I had any
> clue as to writing one :)
>
> But I think I can get where I need to be from the two queries provided,
> thanks all.
>
> J
>
> On 12/15/05, Aaron Rouse <[EMAIL PROTECTED]> wrote:
> >
> > I do this in Oracle with a function I wrote.  I'd think you could do a
> > quick
> > and dirty function in MSSQL that builds the list to return based off a
> > query
> > to the database and looping over that and concatenating them all.  This
> > is
> > not the method I took in Oracle but seems like it would work.
> >
> >
> > On 12/15/05, John Wilker <[EMAIL PROTECTED]> wrote:
> > >
> > > no one?
> > >
> > >
> >
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227684
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to