From: Joe on
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%'"

Thanks
Ramesh

"Ramesh" wrote:

Previous Posts In This Thread:

On Monday, November 26, 2007 1:40 PM
D wrote:

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.

On Monday, November 26, 2007 3:02 PM
Ron Coderre wrote:

Re: Wildcard Character Placement in MS Query
Try this:

Like '%' & [Enter City]

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

Regards,

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

On Monday, November 26, 2007 3:36 PM
D wrote:

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?

"Ron Coderre" wrote:

On Monday, November 26, 2007 4:46 PM
Ron Coderre wrote:

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,

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

On Tuesday, November 27, 2007 12:05 AM
An wrote:

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

"DT" wrote:

On Tuesday, November 27, 2007 11:00 AM
D wrote:

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 the
tables.

"Ron Coderre" wrote:

On Tuesday, February 12, 2008 6:05 PM
Rames wrote:

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,
Ramesh

"Anu" wrote:

On Tuesday, February 12, 2008 6:21 PM
Rames wrote:

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%'"

Thanks
Ramesh

"Ramesh" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Creating a WPF Custom Control
http://www.eggheadcafe.com/tutorials/aspnet/32d63678-2798-465e-ad29-c0b45fb68b78/creating-a-wpf-custom-con.aspx