ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Wildcard character in MS Query (https://www.excelbanter.com/excel-discussion-misc-queries/164848-wildcard-character-ms-query.html)

Grd

Wildcard character in MS Query
 
Hi There,

I'm using a parameter for eg [Please enter City] in my MSQuery connecting to
my SQL SErver database. How do I allow for an all option. I think it is using
a wildcard but can't quite figure it out.

Any help greatly appreciated

Gordon

Ron Coderre

Wildcard character in MS Query
 
If your SQL is set up to use the LIKE operator, the code will accommodate
anything your parameter specifies.

Example:
WHERE City LIKE [Please enter City]

If the parameter equals: Paris
Only "Paris" entries will be returned.

However, if the parameter is: P*
All cities beginning with "P" will be returned.

Note: you may need to change the wildcard character to suit your DB.

Does that help?
Post back if you have more questions.
--------------------------

Regards,

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


Just an asterisk returns all cities.
"Grd" wrote in message
...
Hi There,

I'm using a parameter for eg [Please enter City] in my MSQuery connecting
to
my SQL SErver database. How do I allow for an all option. I think it is
using
a wildcard but can't quite figure it out.

Any help greatly appreciated

Gordon




Grd

Wildcard character in MS Query
 
Thanks

Will give that a go

"Ron Coderre" wrote:

If your SQL is set up to use the LIKE operator, the code will accommodate
anything your parameter specifies.

Example:
WHERE City LIKE [Please enter City]

If the parameter equals: Paris
Only "Paris" entries will be returned.

However, if the parameter is: P*
All cities beginning with "P" will be returned.

Note: you may need to change the wildcard character to suit your DB.

Does that help?
Post back if you have more questions.
--------------------------

Regards,

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


Just an asterisk returns all cities.
"Grd" wrote in message
...
Hi There,

I'm using a parameter for eg [Please enter City] in my MSQuery connecting
to
my SQL SErver database. How do I allow for an all option. I think it is
using
a wildcard but can't quite figure it out.

Any help greatly appreciated

Gordon






All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com