Link to home
Start Free TrialLog in
Avatar of vacnet
vacnet

asked on

Custom "between" criteria in Access Query.

Looking to retrieve all values between records listing AA-1 through AA-96 (ie. between "AA-1" and "AA-96"). Since its not a whole number, I assume it won't retrieve the exact values I'm looking for.
Avatar of jamesgu
jamesgu

try this

select * from <table_name>
where convert(int, replace(<your_column_name>, 'AA-', ''))  between 1 and 96;

Avatar of vacnet

ASKER

jamesqu,

Returns "Undefined function 'convert' in expression.
select * from <table_name>
where CInt(replace(<your_column_name>, 'AA-', ''))  between 1 and 96;

Avatar of vacnet

ASKER

jamesqu,

Returns "Overflow".
ASKER CERTIFIED SOLUTION
Avatar of jamesgu
jamesgu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vacnet

ASKER

Works perfectly! Thank you jamesqu.