using "LIKE" in a query

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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).
 
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).
 
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).
 
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).
 
Back
Top