Thank in advance!
I have a query where I'm searching an inventory database. This database has items grouped by categories (headers). What I'm trying to do is search only the descriptions from the categories (no problem), but, what I need returned is the items also under the categories searched . Can I use a sub-query to do that?
Here's my search query:
Essentially I want the items and headers returned which would be the ones where header = 0 (but only the items of the ones returned).
Thanks,
Dale
I have a query where I'm searching an inventory database. This database has items grouped by categories (headers). What I'm trying to do is search only the descriptions from the categories (no problem), but, what I need returned is the items also under the categories searched . Can I use a sub-query to do that?
Here's my search query:
Code:
PROCEDURE Main_InvSch
@NameSch nvarchar(70)
as
SELECT * from Main_inventory
where charindex(@NameSch, [descrip]) > 0 and header = 1
order by [descrip]
Essentially I want the items and headers returned which would be the ones where header = 0 (but only the items of the ones returned).
Thanks,
Dale