If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Querying data from two fields
I have a table that contains the fields Last_Name and Old_Last_Name, among
others. I'm looking to create a query that will return a record if either of the fields matches a parameter entered by a user. How can I accomplish this? TIA, Steve -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
"Steve Hart via AccessMonster.com" wrote in message news:4fc2eb3b682341ea80bb46635ded54eb@AccessMonste r.com... I have a table that contains the fields Last_Name and Old_Last_Name, among others. I'm looking to create a query that will return a record if either of the fields matches a parameter entered by a user. How can I accomplish this? TIA, Steve Steve, It should be something like: PARAMETERS [Enter Search Parameter] TEXT(255); SELECT T1.Last_Name ,T1.Old_Last_Name FROM YourTable as T1 WHERE (T1.Last_Name = [Enter Search Parameter]) OR (T1.Old_Last_Name = [Enter Search Parameter]); Or, for more flexibility: PARAMETERS [Enter Search Parameter] TEXT(255); SELECT T1.Last_Name ,T1.Old_Last_Name FROM YourTable as T1 WHERE (T1.Last_Name LIKE "*" & [Enter Search Parameter] & "*") OR (T1.Old_Last_Name LIKE "*" & [Enter Search Parameter] & "*"); (I saved them, so their syntax is ok, but didn't test them.) Sincerely, Chris O. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
BUG: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255 characters | [SolarAngel] | Running & Setting Up Queries | 5 | December 7th, 2004 06:29 PM |
BUG: Using GROUP BY in query expression on MEMO fields it truncates data in MEMO fields to first 255 characters | [SolarAngel] | Setting Up & Running Reports | 5 | December 7th, 2004 06:29 PM |
How do I get 3 series in sync with the x-axis? | zizbird | Charts and Charting | 10 | October 25th, 2004 01:23 PM |
Data Source issues. ??data.access.pages | Phil | Database Design | 2 | October 11th, 2004 02:42 AM |
How to warn users to input data in certain fields | Casa | General Discussion | 1 | August 22nd, 2004 09:39 PM |