Link to home
Start Free TrialLog in
Avatar of dleads
dleads

asked on

Convert like statement from Access QBD to SQL

Could someone please advise the syntax used in sql for this command that was in QBD in Access?

Like '[2-3]*[!0]*'

Thanks in advance!
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

(( yourfield Like '2*' or yourfield Like '3*' ) and yourfield not like '*0*')
Sql use % instead of *
looks like I misread the migration products... :)
I agree with capricorn, for sql 2005, the condition looks like this:


Like '[2-3]%[!0]%'
Avatar of dleads
dleads

ASKER

I think we're close...

I'm trying to place this in the filter of a view (in the design view).
When I put this exact statement in
Like '[2-3]%[!0]%'
I get an error "Data type error in expresseion.'
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

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
ASKER CERTIFIED SOLUTION
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 dleads

ASKER

The problem was the numeric field - and the like statement was perfect from both of you.
Therefore I'm awarding angellll a little more on the points.

Thank you both.