VBA can't bring back Like '*active*' records

T

TrickDownie

Does anyone know how to bring filter a SQL using LIKE '*active*'

SQLString = "SELECT downloads.Branch_Number, downloads.msglog_text,
downloads.item_id, downloads.msglog_crtdt "

SQLString = SQLString & "FROM downloads "

SQLString = SQLString & "WHERE (((downloads.Branch_Number)= " &
rst!Branch_Number & ") AND ((downloads.msglog_text) Like '*active*')
AND ((downloads.item_id)= " & rst!item_id & ")) "

SQLString = SQLString & "ORDER BY downloads.msglog_crtdt;"
 
J

John Vinson

Does anyone know how to bring filter a SQL using LIKE '*active*'

SQLString = "SELECT downloads.Branch_Number, downloads.msglog_text,
downloads.item_id, downloads.msglog_crtdt "

SQLString = SQLString & "FROM downloads "

SQLString = SQLString & "WHERE (((downloads.Branch_Number)= " &
rst!Branch_Number & ") AND ((downloads.msglog_text) Like '*active*')
AND ((downloads.item_id)= " & rst!item_id & ")) "

SQLString = SQLString & "ORDER BY downloads.msglog_crtdt;"

If there is a Text field named msglog_text (*NOT* a Lookup field,
which will contain a concealed ID number) in the Downloads table this
should work. What is happening? What error (if any) are you getting?
Do you get anything if you use

LIKE '*'

as the criterion?

John W. Vinson[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

Top