using "LIKE" in a query

G

Guest

SELECT [D].[Pickup Date],
FROM [t], [Data 04] WHERE [t].[Site PN] LIKE (* [D].*);

I have two tables ... D has the same part in t (30) in
different forms (30, 030, 0030 etc). I would like to
choose all three parts from D for all the parts in t. How
would I do it without listing each part(I have 100's).

Thankyou
 
M

Marshall Barton

SELECT [D].[Pickup Date],
FROM [t], [Data 04] WHERE [t].[Site PN] LIKE (* [D].*);

I have two tables ... D has the same part in t (30) in
different forms (30, 030, 0030 etc). I would like to
choose all three parts from D for all the parts in t. How
would I do it without listing each part(I have 100's).



Try using

.. . . WHERE D.I LIKE "*" & t.[Site PN];

but I can't tell if that's going to produce whatever results
you're looking for (that's going to match 230, 4530, etc).
 
G

Guest

Thanks ... It should help.
-----Original Message-----
SELECT [D].[Pickup Date],
FROM [t], [Data 04] WHERE [t].[Site PN] LIKE (* [D]. *);

I have two tables ... D has the same part in t (30) in
different forms (30, 030, 0030 etc). I would like to
choose all three parts from D for all the parts in t. How
would I do it without listing each part(I have 100's).



Try using

.. . . WHERE D.I LIKE "*" & t.[Site PN];

but I can't tell if that's going to produce whatever results
you're looking for (that's going to match 230, 4530, etc).
 
G

Guest

SELECT [turck parts].[ID Number], [turck parts].[Part
Number]
FROM [Data 04], [turck parts]
WHERE ((([turck parts].[Site PN]) Like "*" & [Data 04].
[Item Code]));

is giving me nothing eve though I have data.
-----Original Message-----
SELECT [D].[Pickup Date],
FROM [t], [Data 04] WHERE [t].[Site PN] LIKE (* [D]. *);

I have two tables ... D has the same part in t (30) in
different forms (30, 030, 0030 etc). I would like to
choose all three parts from D for all the parts in t. How
would I do it without listing each part(I have 100's).



Try using

.. . . WHERE D.I LIKE "*" & t.[Site PN];

but I can't tell if that's going to produce whatever results
you're looking for (that's going to match 230, 4530, etc).
 
M

Marshall Barton

SELECT [turck parts].[ID Number], [turck parts].[Part
Number]
FROM [Data 04], [turck parts]
WHERE ((([turck parts].[Site PN]) Like "*" & [Data 04].
[Item Code]));

is giving me nothing eve though I have data.


According to your previous post, you sitll have the Operands
in the wrong order. The partial number needs to be on the
right side. For example, this will not work:

"30" Like "*0030"

but this will do what you want:

"0030" Like "*30"

Try changing your Where clause to:

WHERE [Data 04].[Item Code] Like "*" & [turck parts].[Site
PN]
--
Marsh
MVP [MS Access]



-----Original Message-----
SELECT [D].[Pickup Date],
FROM [t], [Data 04] WHERE [t].[Site PN] LIKE (* [D]. *);

I have two tables ... D has the same part in t (30) in
different forms (30, 030, 0030 etc). I would like to
choose all three parts from D for all the parts in t. How
would I do it without listing each part(I have 100's).



Try using

.. . . WHERE D.I LIKE "*" & t.[Site PN];

but I can't tell if that's going to produce whatever results
you're looking for (that's going to match 230, 4530, etc).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top