|
-
Jun 26th, 2010, 08:41 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Simplify this SQL Statement?
In the Access Query Designer I am limited to 255 characters in the 'Criteria' field.
Is there any way to accomplish this with less characters?
Like "*" & "06-" & "*" And Not Like "*" & "106-" & "*" Or Like "*" & "07-" & "*" And Not Like "*" & "107-" & "*" Or Like "*" & "08-" & "*" And Not Like "*" & "108-" & "*" Or Like "*" & "09-" & "*" And Not Like "*" & "109-" & "*" Or Like "*" & "10-" & "*" And Not Like "*" & "110-" & "*" Or Like "*" & "11-" & "*" And Not Like "*" & "111-" & "*" Or Like "*" & "12-" & "*" And Not Like "*" & "112-" & "*" Or Like "*" & "13-" & "*" And Not Like "*" & "113-" & "*"
I have values in my table which are like "06-01", "06-02",...."106-01", "106-02", etc.
I'm trying to get only the values that equal "06" and not "106". Withouth the above criteria, the query returns both "06" and "106", for example, when only "06" is wanted.
The SQL criteria above works great, but since I'm limited to 255 characters, I cannot get "06-" through "20"... had to stop at "13", save the query, print the report, then change the criteria for pages 14-20.
Not ideal at all.
-
Jun 27th, 2010, 12:19 AM
#2
Re: Simplify this SQL Statement?
I have values in my table which are like "06-01", "06-02",...."106-01", "106-02", etc.
Firstly, you can cut down the length dramatically by using
"*06-*" instead of "*" & "06-" & "*"
"*106-*" instead of "*" & "106-" & "*"
Secondly, that whole lot can be simplified to this:
Like "0[6-9]-*" Or Like "1[0-9]-*" Or Like "20-*"
-
Jun 27th, 2010, 08:57 AM
#3
Thread Starter
Hyperactive Member
Re: Simplify this SQL Statement?
My friend, you have saved the day. That works perfectly!
-
Jun 27th, 2010, 08:59 AM
#4
Thread Starter
Hyperactive Member
Re: Simplify this SQL Statement?
I am unable to give add to anyone's reputation. It says I must spread some around. I get this message for every person I try to Rate. What gives Moderators?
-
Jun 28th, 2010, 08:31 AM
#5
Re: Simplify this SQL Statement?
 Originally Posted by jazFunk
I am unable to give add to anyone's reputation. It says I must spread some around. I get this message for every person I try to Rate. What gives Moderators?
I'm not sure of the numbers, but you cannot give a rating to the same person within X days, and/or until you have rated Y other people.
I have a feeling that at the moment X is 10 and Y is 5, but that could be wrong.
For more info on ratings and reputations, see here.
By the way, you were lucky that I saw your post... if you want to ask a moderator/admin about site usage, you should generally post in our Forum Feedback forum, which is near the bottom of the list of forums.
-
Jun 30th, 2010, 06:17 PM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] Simplify this SQL Statement?
Thanks for the links and info.
I suppose it was a bit presumptuous to think a moderator would be reading this post.
Again, thank you.
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
|