Between to values

R

Rick Dunmire

Hello all
This SQL fragment works ok.

"WHERE Inspection.sticker_exp_month =" & Combo1.Text & " " & _
"OR Inspection.sticker_exp_month =" & Combo2.Text & " " & _
"ORDER BY Inspection.sticker_exp_month")

I get a result from the inspection_exp_month when I select
lets say 4 from combo1 and 6 from combo2. No problem there.
What I need is to select the values from combo1 and combo2 and include every
value in between
(4,5,6).
I know I need the BETWEEN statement here somewhere.

This is from access but I can't seem to hold my tongue right to make this
work I guess.
"WHERE ( " & _
" ( " & _
" (Inspection.sticker_exp_month) Between combo1.value " & _
" And combo2.value)) " & _
"ORDER BY " & _
" Inspection.sticker_exp_month"

Can someone help
Thanks
Rick Dunmire
 
S

Steve Schapel

Rick,

Try this...
"WHERE Inspection.sticker_exp_month Between " & combo1 & " And " &
combo2 & _
" ORDER BY Inspection.sticker_exp_month"

- Steve Schapel, Microsoft Access MVP
 
R

Rick Dunmire

Thanks Steve
That works, just what I needed.
Rick
Steve Schapel said:
Rick,

Try this...
"WHERE Inspection.sticker_exp_month Between " & combo1 & " And " &
combo2 & _
" ORDER BY Inspection.sticker_exp_month"

- Steve Schapel, Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top