To use parameter with like.



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
.



Relevant Pages

  • RE: (Excel 2007) Query Data in Database?
    ... are both headers of the Sheet in Excel, ... Is the ADDRESS field to much for the Microsoft Jet database engine? ... When you do a query you should be selecting the columns You want to ... the sort has to be one of these columns. ...
    (microsoft.public.excel.programming)
  • Re: Split database into smaller db based on values
    ... Why have the Excel file "query the database"? ... "Jeff Boyce" wrote: ...
    (microsoft.public.access.modulesdaovba)
  • Re: Excel Access interface
    ... You could create a 'stored procedure' in the database. ... > You can create an External Data table in Excel that uses a parameter query. ... > prompt you to input values for each parameter that you entered. ...
    (microsoft.public.excel.programming)
  • Re: How can I change the source of my extern source database in an
    ... Excel Blog - Daily Dose of Excel ... >>> that if he uses the query's he has to select an external database, ... >>>> click the edit query icon. ...
    (microsoft.public.excel.programming)
  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)