C
Contro
Hi guys!
I've ran into a problem. I'm basically trying to find the number of
rows which contain values of certain decades. They can be in the
formats
70, 60, 90
1990, 1995, 2000
or maybe even
70, 1990, 20, 1980
Basically I want the user to be able to enter the decade. So they'd
enter either "9" and that would pick up entries of either 1990 and 95.
The problem is making it pick up both that kind of entry with no
problems. It's perfectly fine for other decades bar 1990, but the
code, no matter how hard I try, keeps picking up entries for 1980 (any
year with 19 at the front) as well as 90 when I search for decades
inputting "9".
Here is a snip of my code:
WHERE (((Applications.[Year(s) of Qualification] LIKE "* " & [choice] &
"#*" OR Applications.[Year(s) of Qualification] LIKE "*," & [choice] &
"#*")
AND
Applications.[Year(s) of Qualification] NOT LIKE "* #" & [choice] &
"##*" OR Applications.[Year(s) of Qualification] NOT LIKE "*,#" &
[choice] & "##*")
OR
Applications.[Year(s) of Qualification] LIKE "* #" & [choice] & "##*"
OR Applications.[Year(s) of Qualification] LIKE "*,#" & [choice] &
"##*");
This seems overly complicated, and I'm sure there is an easier way, but
I just don't know how. Some kind of OR condition function available in
the LIKE part or something...if you could help, that would be great!
The code above doesn't work as it logically isn't sound. But I don't
know how else to try it!
I hope it makes sense. It's kind of hard to explain, but basically
when searching for decades in the 90's, it picks up 1980 or 1975 or
1955 (picking up the nine).
Thank you so much in advance!
Contro.
I've ran into a problem. I'm basically trying to find the number of
rows which contain values of certain decades. They can be in the
formats
70, 60, 90
1990, 1995, 2000
or maybe even
70, 1990, 20, 1980
Basically I want the user to be able to enter the decade. So they'd
enter either "9" and that would pick up entries of either 1990 and 95.
The problem is making it pick up both that kind of entry with no
problems. It's perfectly fine for other decades bar 1990, but the
code, no matter how hard I try, keeps picking up entries for 1980 (any
year with 19 at the front) as well as 90 when I search for decades
inputting "9".
Here is a snip of my code:
WHERE (((Applications.[Year(s) of Qualification] LIKE "* " & [choice] &
"#*" OR Applications.[Year(s) of Qualification] LIKE "*," & [choice] &
"#*")
AND
Applications.[Year(s) of Qualification] NOT LIKE "* #" & [choice] &
"##*" OR Applications.[Year(s) of Qualification] NOT LIKE "*,#" &
[choice] & "##*")
OR
Applications.[Year(s) of Qualification] LIKE "* #" & [choice] & "##*"
OR Applications.[Year(s) of Qualification] LIKE "*,#" & [choice] &
"##*");
This seems overly complicated, and I'm sure there is an easier way, but
I just don't know how. Some kind of OR condition function available in
the LIKE part or something...if you could help, that would be great!
The code above doesn't work as it logically isn't sound. But I don't
know how else to try it!
I hope it makes sense. It's kind of hard to explain, but basically
when searching for decades in the 90's, it picks up 1980 or 1975 or
1955 (picking up the nine).
Thank you so much in advance!
Contro.