Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default SQL & Like Parameters

I would like to have the operator prompted for a "like" value. For
instance, I would like the operator to be prompted to enter the word
PUSH if the description field contains PUSH anywhere in the
description.
This is a query using microsoft query which returns data to excel.
For normal parameter queries you enter in the criteria something like
[Enter value to search for]. That works on queries for "equal"
conditions, but I can't figure out how to prompt for a "Like"
condition that I want the user to be able to enter the parameter for.

For instance I think I need to enter something like:

Like "'%"[Enter value to search for]"%'" but that doesn't seem to
work. I could write this in the SQL native if someone could give me an
idea how to do that too, since the query criteria eventually gets
generated into SQL anyway.

Can anyone help me? This is a unique situation because of the LIKE
and wild-card symbols.

thanks,
ga
George Applegate

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default SQL & Like Parameters

Just a dump idea until you get a better one - you could have the criteria be:
Like [Enter Data]

Then when the enter parameter value box appears type Data%

For example if you are looking for a number that begins with 7:

Enter Data: 7%

This will bring up the needed info.

"George Applegate" wrote:

I would like to have the operator prompted for a "like" value. For
instance, I would like the operator to be prompted to enter the word
PUSH if the description field contains PUSH anywhere in the
description.
This is a query using microsoft query which returns data to excel.
For normal parameter queries you enter in the criteria something like
[Enter value to search for]. That works on queries for "equal"
conditions, but I can't figure out how to prompt for a "Like"
condition that I want the user to be able to enter the parameter for.

For instance I think I need to enter something like:

Like "'%"[Enter value to search for]"%'" but that doesn't seem to
work. I could write this in the SQL native if someone could give me an
idea how to do that too, since the query criteria eventually gets
generated into SQL anyway.

Can anyone help me? This is a unique situation because of the LIKE
and wild-card symbols.

thanks,
ga
George Applegate


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default SQL & Like Parameters

Randi -

This worked sort of...Once the query was created, in order to get a
prompt message (I have two parms I'm prompting for) I had to go into
the spreadsheet under Tools/Macro/Microsoft script editor and add the
prompt string I wanted to show in the prompt box.

But at least it is working . Thanks a ton for your suggestion and
assistance. Putting in the % sign isn't a big price to pay.

ga

Randi wrote:

Just a dump idea until you get a better one - you could have the criteria be:
Like [Enter Data]

Then when the enter parameter value box appears type Data%

For example if you are looking for a number that begins with 7:

Enter Data: 7%

This will bring up the needed info.

"George Applegate" wrote:

I would like to have the operator prompted for a "like" value. For
instance, I would like the operator to be prompted to enter the word
PUSH if the description field contains PUSH anywhere in the
description.
This is a query using microsoft query which returns data to excel.
For normal parameter queries you enter in the criteria something like
[Enter value to search for]. That works on queries for "equal"
conditions, but I can't figure out how to prompt for a "Like"
condition that I want the user to be able to enter the parameter for.

For instance I think I need to enter something like:

Like "'%"[Enter value to search for]"%'" but that doesn't seem to
work. I could write this in the SQL native if someone could give me an
idea how to do that too, since the query criteria eventually gets
generated into SQL anyway.

Can anyone help me? This is a unique situation because of the LIKE
and wild-card symbols.

thanks,
ga
George Applegate



George Applegate

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solver not following parameters Homer Excel Worksheet Functions 0 May 25th 07 04:17 AM
Too few parameters lou sanderson Excel Discussion (Misc queries) 1 January 13th 06 06:35 PM
too few parameters lou sanderson Excel Discussion (Misc queries) 1 December 14th 05 07:53 PM
Vlookup with to parameters Amnon Wilensky Excel Worksheet Functions 3 June 11th 05 06:36 PM
Sort parameters Abe Excel Discussion (Misc queries) 4 May 9th 05 07:01 PM


All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"