Prev: Matrix?
Next: Registry issue
From: mcolson on
I'm trying to write a query for my Dataset's table adapter. It is
linked to an access 2003 database. Basically, I'm trying to duplicate
the following query.

SELECT Parts_Inventory.Aisle, Parts_Inventory.Rack,
Parts_Inventory.Shelf, Parts_Inventory.QNTY, Parts_Inventory.MFG_PN,
Parts_Inventory.Manufacturer, Parts_Inventory.Description
FROM Parts_Inventory
WHERE (((Parts_Inventory.Manufacturer) Like "*" & [?] & "*"));

I'm using a text box as my control to the manufacturer field. If it
is blank, it will show all my parts.

I'm able to get this too work, but I don't seem to be able to add wild
cards.
SELECT Aisle, Rack, Shelf, QNTY, MFG_PN, Manufacturer, Description
FROM Parts_Inventory
WHERE (Manufacturer = ?)
ORDER BY Aisle, Rack, Shelf, Manufacturer, MFG_PN

Is there anyone familiar with this?
From: mcolson on
On Apr 13, 9:49 am, mcolson <mcolson1...(a)gmail.com> wrote:
> I'm trying to write a query for my Dataset's table adapter.  It is
> linked to an access 2003 database.  Basically, I'm trying to duplicate
> the following query.
>
> SELECT Parts_Inventory.Aisle, Parts_Inventory.Rack,
> Parts_Inventory.Shelf, Parts_Inventory.QNTY, Parts_Inventory.MFG_PN,
> Parts_Inventory.Manufacturer, Parts_Inventory.Description
> FROM Parts_Inventory
> WHERE (((Parts_Inventory.Manufacturer) Like "*" & [?] & "*"));
>
> I'm using a text box as my control to the manufacturer field.  If it
> is blank, it will show all my parts.
>
> I'm able to get this too work, but I don't seem to be able to add wild
> cards.
> SELECT     Aisle, Rack, Shelf, QNTY, MFG_PN, Manufacturer, Description
> FROM         Parts_Inventory
> WHERE     (Manufacturer = ?)
> ORDER BY Aisle, Rack, Shelf, Manufacturer, MFG_PN
>
> Is there anyone familiar with this?

I was using the wrong wild card.

WHERE (Manufacturer LIKE '%' & ? & '%')
 | 
Pages: 1
Prev: Matrix?
Next: Registry issue