|
-
July 27th, 2009, 01:24 AM
#1
SQL Issue
I have the following sql code:
Code:
sql1 = "SELECT Distinct(TraceID) FROM Trn_SO_Details WHERE SODt='" + InvtDt + "' AND ProdCode='" + ProdCode + "' " 'TStatus Not IN('Processed','PROCESSED') AND T.ErrorType Not IN('Duplicate')"
sql1 &= " AND TraceID=(select TraceID from Trn_SO Where Status NOT IN('Processed','PROCESSED') AND ErrorType Not IN('Duplicate')) "
objDB.OpenDataSet(ds, sql1)
ds.Tables(0).TableName = "InvtDetails"
But I get the following errors:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
If the subquery only return one result,then it works fine,but if the subquery return more than one results, then the error occured,how can I resolve this error?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|