Search or Find

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I really need help on this:
I want to search for a certain text or number on a table
for example in this query:
SELECT *
FROM MasterList
WHERE (((MasterList.UNIT)=[Enter Unit:]));
in this query it has a parameter that asks for UNIT in the MasterList table.
I would like to know if i there is a way to find values from any fields? not
just in the UNIT field but in all fields.
 
Hi,


Not habitual, but yes:

SELECT *
FROM masterList
WHERE [Enter Unit] IN(Unit, otherfield1, otherfield2, otherfield3)


hoping it may help,
Vanderghast, Access MVP
 
Thanks for the urgent reply. yes, it's working.
what i really want is to find a record in any field not just the UNIT,
whether a number or a text.
your answer works but it only works for values with same data type. because
i could find numbers but not text.i receive a message whenever i type text ,
it says "This expression is type incorrectly, or it is too complex to be
evaluated..."
is there a way that i can find any record whether its text or number?

thanks again! :) Please reply again soon. I really need this today. thanks!

Michel Walsh said:
Hi,


Not habitual, but yes:

SELECT *
FROM masterList
WHERE [Enter Unit] IN(Unit, otherfield1, otherfield2, otherfield3)


hoping it may help,
Vanderghast, Access MVP

joni said:
I really need help on this:
I want to search for a certain text or number on a table
for example in this query:
SELECT *
FROM MasterList
WHERE (((MasterList.UNIT)=[Enter Unit:]));
in this query it has a parameter that asks for UNIT in the MasterList
table.
I would like to know if i there is a way to find values from any fields?
not
just in the UNIT field but in all fields.
 
Hi,


Maybe the trick would be to convert the data to a string? that would be
quite slow, on the other hand:


WHERE CString([Enter Unit]) IN( CString(Unit), CString(otherfield1),
CString(otherfield2), CString(otherfield3))


note that if a field is already a sequence of character, you don't need to
use CString( ) around it... it is already a string. :-)



Hoping it may help,
Vanderghast, Access MVP



joni said:
Thanks for the urgent reply. yes, it's working.
what i really want is to find a record in any field not just the UNIT,
whether a number or a text.
your answer works but it only works for values with same data type.
because
i could find numbers but not text.i receive a message whenever i type text
,
it says "This expression is type incorrectly, or it is too complex to be
evaluated..."
is there a way that i can find any record whether its text or number?

thanks again! :) Please reply again soon. I really need this today.
thanks!

Michel Walsh said:
Hi,


Not habitual, but yes:

SELECT *
FROM masterList
WHERE [Enter Unit] IN(Unit, otherfield1, otherfield2, otherfield3)


hoping it may help,
Vanderghast, Access MVP

joni said:
I really need help on this:
I want to search for a certain text or number on a table
for example in this query:
SELECT *
FROM MasterList
WHERE (((MasterList.UNIT)=[Enter Unit:]));
in this query it has a parameter that asks for UNIT in the MasterList
table.
I would like to know if i there is a way to find values from any
fields?
not
just in the UNIT field but in all fields.
 
ok. i understand now. thanks! :-)

Michel Walsh said:
Hi,


Maybe the trick would be to convert the data to a string? that would be
quite slow, on the other hand:


WHERE CString([Enter Unit]) IN( CString(Unit), CString(otherfield1),
CString(otherfield2), CString(otherfield3))


note that if a field is already a sequence of character, you don't need to
use CString( ) around it... it is already a string. :-)



Hoping it may help,
Vanderghast, Access MVP



joni said:
Thanks for the urgent reply. yes, it's working.
what i really want is to find a record in any field not just the UNIT,
whether a number or a text.
your answer works but it only works for values with same data type.
because
i could find numbers but not text.i receive a message whenever i type text
,
it says "This expression is type incorrectly, or it is too complex to be
evaluated..."
is there a way that i can find any record whether its text or number?

thanks again! :) Please reply again soon. I really need this today.
thanks!

Michel Walsh said:
Hi,


Not habitual, but yes:

SELECT *
FROM masterList
WHERE [Enter Unit] IN(Unit, otherfield1, otherfield2, otherfield3)


hoping it may help,
Vanderghast, Access MVP

I really need help on this:
I want to search for a certain text or number on a table
for example in this query:
SELECT *
FROM MasterList
WHERE (((MasterList.UNIT)=[Enter Unit:]));
in this query it has a parameter that asks for UNIT in the MasterList
table.
I would like to know if i there is a way to find values from any
fields?
not
just in the UNIT field but in all fields.
 
Back
Top