|
-
May 2nd, 2007, 11:17 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Filtering a column in a Query
Which method has to be used in order to add a filter to a query's column?
Last edited by Fonty; May 8th, 2007 at 07:54 AM.
-
May 3rd, 2007, 10:44 PM
#2
Hyperactive Member
Re: Filtering a column in a Query
More information please. What program/version/query?
Rate my response if I helped
Go Hard Or Go Home
-
May 4th, 2007, 07:46 AM
#3
Thread Starter
Addicted Member
Re: Filtering a column in a Query
I have a query in Access which generates a set of 4 fields permutations in a table (let's say PER).
One of the fields (let's say FIELD_X)can take only 6 values (let's say VAL1,...VAL5, VAL6)
I would like to have a macro which could, open the query, add a filter to FIELD_X, then run the query for VAL1 filtered, creat table PER_VAL1, then the same for VAL2... etc. In the end I should have 6 tables.
-
May 7th, 2007, 05:47 PM
#4
Hyperactive Member
Re: Filtering a column in a Query
If you were using MS Access code then you would just modify the query at run timel
db.execute "Select * from PER where FIELD_1 = 'somevalue';"
db.execute "Select * from PER where FIELD_2 = 'somevalue';"
You coud do that in a loop or as many times as you like.
If you're not using code then you would add a parameter to your query. In the query designer for MS Access you would set up a parameter so that MS Access prompts you for a value at runtime and then filters against that value.
Rate my response if I helped
Go Hard Or Go Home
-
May 7th, 2007, 06:36 PM
#5
Thread Starter
Addicted Member
Re: Filtering a column in a Query
I'm getting run-time error 3065, which says I cannot execute a Select Query. My query is a Select Query type. How could I correct this?
-
May 8th, 2007, 04:11 AM
#6
Hyperactive Member
Re: Filtering a column in a Query
Code:
docmd.runSql "Select * Into PER_VAL1 from PER where FIELD_2 = 'val1';"
........
Hope it will resolves the problem
The Difference between a Successful person and others is not a Lack of Knowledge,
But rather a Lack of WILL 
-
May 8th, 2007, 07:54 AM
#7
Thread Starter
Addicted Member
Re: Filtering a column in a Query
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|