Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7 - Access 2010 query parameters

 
11-08-2011   #1


Win 7 Pro 64 bit
 
 

Access 2010 query parameters

Hello,

How do I include a portion of a field in a query parameter?

For example, if one record's data in the field I'm querying is, say, "RPMX-1011" and another record's data is, say, "CO-0852", how do I tell the query I want all records that have "PM" appearing somewhere in the field?

My System SpecsSystem Spec
11-08-2011   #2


Windows 7 Home Premium 64bit - Dutch
 
 


select * from tablename where fieldname like "*PM*"
My System SpecsSystem Spec
11-08-2011   #3


Windows 7 Professional x64
 
 


Quote   Quote: Originally Posted by Kaktussoft View Post
select * from tablename where fieldname like "*PM*"
i agree
My System SpecsSystem Spec
.


11-08-2011   #4


Win 7 Pro 64 bit
 
 


I'm sorry - it's clear to you two, but not to me. When you say "select * from tablename", does that mean I drag the * into my query? And what does "where fieldname like "*PM*" mean? Do I type "like "*PM*"" somewhere? I'm not getting the results I need.
My System SpecsSystem Spec
11-08-2011   #5


Windows 7 Home Premium 64bit - Dutch
 
 


You're making a query using fields drag and drop? Then make the query as complete as you can. Can you make a parameter query? for example can you make a query that displays the birthday and name but only of the persons with name "Johnson"? I don't know your skills so don't know who to explain
My System SpecsSystem Spec
11-09-2011   #6


Win 7 Pro 64 bit
 
 


Well, the query already exists (I've been using it for some time even tho it doesn't give me fully accurate results), so I opened it and changed to Design view so I can edit it. From there, I dragged the * from the available fields in the table I'm using into the query. Yes, I believe I could do a query for all people named Johnson with a certain birthdate.
My System SpecsSystem Spec
11-09-2011   #7


Windows 7 Home Premium 64bit - Dutch
 
 


Make the query as good as possible. After that change to sql view. Post sql statement here please.
My System SpecsSystem Spec
11-09-2011   #8


Win 7 Pro 64 bit
 
 


SELECT [Business Licenses].[Lic#], [Business Licenses].BusinessName, [Business Licenses].FName, [Business Licenses].LName, [Business Licenses].MailAddr, [Business Licenses].City, [Business Licenses].State, [Business Licenses].Zip, [Business Licenses].BsPh
FROM [Business Licenses]
WHERE ((([Business Licenses].[Lic#]) Like "*PM*") AND (([Business Licenses].TypeOfBs)="property management"));
My System SpecsSystem Spec
11-09-2011   #9


Windows 7 Home Premium 64bit - Dutch
 
 


your query is right!
It displays all fields listed after select. But only for those records where TypeOfBs="property management" and Lic# like "*PM*"

what's the problem????
My System SpecsSystem Spec
11-09-2011   #10


Win 7 Pro 64 bit
 
 


The problem is there are some licenses that have "PM" as part of their license number that are not being included in the query results. Perhaps it's because there is also other text in the "property management" field?

Last edited by CosmicJest; 11-09-2011 at 12:00 PM.. Reason: addl info
My System SpecsSystem Spec
Reply

 Access 2010 query parameters problems?



Thread Tools



Similar Threads for: Access 2010 query parameters
Thread Forum
Any problems using Access 2007 database with Access 2010? Microsoft Office
Access 2010 Microsoft Office
Microsoft Access 2007 Query Help Software
Access 2010 Microsoft Office
Ms Access 2010 or MySQL Microsoft Office


All times are GMT -5. The time now is 05:44 PM.



Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30