Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Sql reorder

Posted on 2007-07-24
2
Medium Priority
?
197 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:JoeBo747
2 Comments
 
LVL 8

Accepted Solution

by:
sabeesh earned 1000 total points
ID: 19560052
Mysql = mySQL = "SELECT [PartID],[Part_Description],[Comment],[PHeight],[PDepth], [PWidth][PWeight] FROM dbo_packaging " & _
        " WHERE ([custid] ='" & strTag & "')" _
        & " and ([partid] = " & sSeltxt & ")

try this
0
 
LVL 1

Author Comment

by:JoeBo747
ID: 19560171
Hi sabeesh:

Well spotted, Thanks.

Regards
Joe
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

804 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question