Sql reorder

Hi Experts

My sql when debugged produces an sql string which has the closing colon and   parenthesis on line two as below:

SELECT [PartID],[Part_Description],[Comment],[PHeight],[PDepth], [PWidth][PWeight] FROM dbo_packaging  WHERE ([custid] ='Noby0001') and ([partid] = '7896535
')

Partid is a string and the query produces no rows if I paste the sql into a query pane and recreate the query so that the end of the sql looks like:

and ([partid] = '7896535)

The query produces rows. How do I reproduce this in my sql statement?

Mysql = mySQL = "SELECT [PartID],[Part_Description],[Comment],[PHeight],[PDepth], [PWidth][PWeight] FROM dbo_packaging " & _
        " WHERE ([custid] ='" & strTag & "')" _
        & " and ([partid] = '" & sSeltxt & "'" & _
        ")"

Regards
Joe
LVL 1
JoeBo747Asked:
Who is Participating?
 
sabeeshConnect With a Mentor Commented:
Mysql = mySQL = "SELECT [PartID],[Part_Description],[Comment],[PHeight],[PDepth], [PWidth][PWeight] FROM dbo_packaging " & _
        " WHERE ([custid] ='" & strTag & "')" _
        & " and ([partid] = " & sSeltxt & ")

try this
0
 
JoeBo747Author Commented:
Hi sabeesh:

Well spotted, Thanks.

Regards
Joe
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.