Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Searching a string in a parameter query


Message #1 by "Howard Stone" <ququmber@h...> on Tue, 21 Aug 2001 04:03:53
What should I put in the Criteria field of a parameter query so that I can 

be prompted to enter any number of character of the 17 character VIN 

number of a motor vehicle.



I have a field called VIN and have been able to figure out entering any 

number of characters "Starting With" and any number of characters "Ending 

With".



I am unable to figure out any number of characters "Containing".



Thanks
Message #2 by "Padgett Rowell" <padgett@i...> on Tue, 21 Aug 2001 14:31:36 +0800
Try wrapping your search criteria with either astors (*) or percentages

(%) (depending on which backend you are using.  Eg:



Select * from my table where myfield Like %searchValue%



Or



Select * from my table where myfield Like *searchValue*



Alternatively you could try an instr() function.  Eg:



Select * from my table where Instr(myfield, searchValue) > 1



padgett



-----Original Message-----

From: Howard Stone [mailto:ququmber@h...] 

Sent: Tuesday, 21 August 2001 4:04 AM

To: Access

Subject: [access] Searching a string in a parameter query



What should I put in the Criteria field of a parameter query so that I

can 

be prompted to enter any number of character of the 17 character VIN 

number of a motor vehicle.



I have a field called VIN and have been able to figure out entering any 

number of characters "Starting With" and any number of characters

"Ending 

With".



I am unable to figure out any number of characters "Containing".



Thanks

Message #3 by John Fejsa <John.Fejsa@h...> on Wed, 22 Aug 2001 08:12:00 +1000
I'm not sure whether you want to search "Containing" in the same field as 



"Starting With" and  "Ending With" but here's my input.   You could use 

BETWEEN to check for "Starting With" and  "Ending  With", ie.  BETWEEN 

[Starting with?] AND [Ending with?].  To use "Containing" you could look 

up LIKE keyword, ie., LIKE "*23" will find 23, 123, 234, 898723...



Maybe I went off track, please clarify your question if I misunderstood 

it.



JohnF



>>> ququmber@h... 21/08/2001 14:03:53 >>>

What should I put in the Criteria field of a parameter query so that I 

can

be prompted to enter any number of character of the 17 character VIN

number of a motor vehicle.



I have a field called VIN and have been able to figure out entering any

number of characters "Starting With" and any number of characters 

"Ending

With".



I am unable to figure out any number of characters "Containing".



Thanks




  Return to Index