Between to values

  • Thread starter Thread starter Rick Dunmire
  • Start date Start date
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
 
Rick,

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

- Steve Schapel, Microsoft Access MVP
 
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
 
Back
Top