Wildcard Character Placement in MS Query

D

DT

I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
R

Ron Coderre

Try this:

Like '%' & [Enter City]

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
D

DT

Thanks for the suggestion. Unfortunately, I received the following error
message:
"Invalid operator for data type. Operator equals boolean AND, type equals
varchar. Statement(s) could not be prepared."

Any other ideas?

Ron Coderre said:
Try this:

Like '%' & [Enter City]

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


DT said:
I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
R

Ron Coderre

I tested my posted LIKE clause using MS Query against an MS Access database.
Are you querying another kind of database?

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

DT said:
Thanks for the suggestion. Unfortunately, I received the following error
message:
"Invalid operator for data type. Operator equals boolean AND, type equals
varchar. Statement(s) could not be prepared."

Any other ideas?

Ron Coderre said:
Try this:

Like '%' & [Enter City]

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


DT said:
I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I
am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
A

Anu

Use % sign as wild card with single quotes eg : Like '%n' will return all
entries ending with n
 
D

DT

I'm using an SQL server database connected through ODBC to get data from the
tables.

Ron Coderre said:
I tested my posted LIKE clause using MS Query against an MS Access database.
Are you querying another kind of database?

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

DT said:
Thanks for the suggestion. Unfortunately, I received the following error
message:
"Invalid operator for data type. Operator equals boolean AND, type equals
varchar. Statement(s) could not be prepared."

Any other ideas?

Ron Coderre said:
Try this:

Like '%' & [Enter City]

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I
am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
R

Ramesh

Does this work same way with Excel (as database) using OLE DB or ADO.NET?

I mean, can I use this wildcard charaters sameway when i am retrieving excel
data using OLE DB connection from VB.NET?

Thanks for your response and time,
Ramesh

Anu said:
Use % sign as wild card with single quotes eg : Like '%n' will return all
entries ending with n

DT said:
I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
R

Ramesh

Sorry, I should have tried and asked the question here. It works same way!

selectCommand = "SELECT * FROM MR WHERE Name LIKE 'R%'"

Thanks
Ramesh

Ramesh said:
Does this work same way with Excel (as database) using OLE DB or ADO.NET?

I mean, can I use this wildcard charaters sameway when i am retrieving excel
data using OLE DB connection from VB.NET?

Thanks for your response and time,
Ramesh

Anu said:
Use % sign as wild card with single quotes eg : Like '%n' will return all
entries ending with n

DT said:
I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.
 
J

Joe Brad

CAST(? AS VARCHAR) + '%' ? represents variable. It does not work for empty variable. Still working on that one.



Rames wrote:

Sorry, I should have tried and asked the question here. It works same way!
12-Feb-08

Sorry, I should have tried and asked the question here. It works same way

selectCommand = "SELECT * FROM MR WHERE Name LIKE 'R%'

Thank
Rames

:

Previous Posts In This Thread:

Wildcard Character Placement in MS Query
I am attempting to establish a parameter in Excel containing a wildcard
before the prompt. I have successfully written it in access as: Like
"*"&[Enter City]) but cannot successfully accomplish it in MS Query. I am
currently entering the wildcard as part of the prompt response but this
limits me in other areas. Thank you for your help.

Re: Wildcard Character Placement in MS Query
Try this

Like '%' & [Enter City

Does that help
-------------------------

Regards

Ro
Microsoft MVP (Excel
(XL2003, Win XP)

Thanks for the suggestion.
Thanks for the suggestion. Unfortunately, I received the following error
message:
"Invalid operator for data type. Operator equals boolean AND, type equals
varchar. Statement(s) could not be prepared.

Any other ideas

:

I tested my posted LIKE clause using MS Query against an MS Access database.
I tested my posted LIKE clause using MS Query against an MS Access database
Are you querying another kind of database

Regards

Ro
Microsoft MVP (Excel
(XL2003, Win XP)

RE: Wildcard Character Placement in MS Query
Use % sign as wild card with single quotes eg : Like '%n' will return al
entries ending with

:

I'm using an SQL server database connected through ODBC to get data from the
I am using an SQL server database connected through ODBC to get data from th
tables

:

Does this work same way with Excel (as database) using OLE DB or ADO.NET?
Does this work same way with Excel (as database) using OLE DB or ADO.NET

I mean, can I use this wildcard charaters sameway when i am retrieving excel
data using OLE DB connection from VB.NET

Thanks for your response and time
Rames

:

Sorry, I should have tried and asked the question here. It works same way!
Sorry, I should have tried and asked the question here. It works same way

selectCommand = "SELECT * FROM MR WHERE Name LIKE 'R%'

Thank
Rames

:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Creating a WPF Custom Control
http://www.eggheadcafe.com/tutorial...9-c0b45fb68b78/creating-a-wpf-custom-con.aspx
 
Top