Help SQL to JET

  • Thread starter Thread starter Joao Tito Livio
  • Start date Start date
J

Joao Tito Livio

Hello, i blocked out with this, can someone help me converting this SQL to
pass in JET (Code). "Test1" and "Test2" are for Form Controls

e.g.

"Test1" change to *Me.txtText.Text*

Thanks
Regards

sql = "SELECT t_aux_sindrome_groups.sindrome_group, t_sindromes.sindrome " &
_
"FROM t_aux_sindrome_groups INNER JOIN t_sindromes ON
t_aux_sindrome_groups.sindrome_group_id = t_sindromes.sindrome_group_id " &
_
"WHERE (((t_aux_sindrome_groups.sindrome_group) Like "*" & "Test1" & "*")
AND ((t_sindromes.sindrome) Like "*" & "Test2" & "*"));"
 
Hello, i blocked out with this, can someone help me converting this SQL to
pass in JET (Code). "Test1" and "Test2" are for Form Controls

e.g.

"Test1" change to *Me.txtText.Text*

Thanks
Regards

sql = "SELECT t_aux_sindrome_groups.sindrome_group, t_sindromes.sindrome " &
_
"FROM t_aux_sindrome_groups INNER JOIN t_sindromes ON
t_aux_sindrome_groups.sindrome_group_id = t_sindromes.sindrome_group_id " &
_
"WHERE (((t_aux_sindrome_groups.sindrome_group) Like "*" & "Test1" & "*")
AND ((t_sindromes.sindrome) Like "*" & "Test2" & "*"));"

The problem appears to be that you're including " marks inside a
string delimited by ". Try using ' as a delimiter instead, and
simplifying some of the excess concatenations:

sql = "SELECT t_aux_sindrome_groups.sindrome_group,
t_sindromes.sindrome " & _
"FROM t_aux_sindrome_groups INNER JOIN t_sindromes ON
t_aux_sindrome_groups.sindrome_group_id =
t_sindromes.sindrome_group_id " & _
"WHERE (((t_aux_sindrome_groups.sindrome_group) Like '*Test1*')
AND ((t_sindromes.sindrome) Like '*Test2*'));"

Correct the newsgroup wordwrap first of course...
 
Back
Top