WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQL & Like and parameters

 
   Home -> Office -> Query DAO RSS
Next:  Excel 07 selects 3 cells when I click on 1  
Author Message
George Applegate

External


Since: Aug 16, 2007
Posts: 11



(Msg. 1) Posted: Thu Nov 01, 2007 10:54 am
Post subject: SQL & Like and parameters
Archived from groups: microsoft>public>excel>querydao (more info?)

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
gappleg8.DeleteThis@fmctc.com
Back to top
Login to vote
Bill Manville

External


Since: Jul 30, 2004
Posts: 669



(Msg. 2) Posted: Fri Nov 02, 2007 5:57 pm
Post subject: Re: SQL & Like and parameters [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think Microsoft Query has trouble parsing that condition.

I succeeded as follows:
In the query grid I entered the condition as Like [Param]
To test it I entered %PUSH% and it worked

I returned the results to Excel and associated the parameter with a
cell, in my case E2, specifying it to refresh automatically when the
cell changes.

In E2 I entered the formula ="%"&E3&"%"
The when I entered PULL in E3 it returns results for which the field
contains "PULL" etc.

So all you need then is some suitable UI for your user to get the value
to be sought into an appropriate cell (in my case E3)

Bill Manville
MVP - Microsoft Excel, Oxford, England
Back to top
Login to vote
krishsg




Joined: Nov 15, 2007
Posts: 2



(Msg. 3) Posted: Tue Nov 20, 2007 3:52 am
Post subject: Re: SQL & Like and parameters [Login to view extended thread Info.]

i am also having same problem

similarly if i put ALL as a value for parameter Like [Param] i should get all the entries in the table.

how to do this

thanks

Krishna
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Query DAO All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET