[求助]sql代码那里错了
SELECT N'' AS SelCol, isotype, ID, bRdFlag, cVouchType, cVouchName, dmadedate, cBusType, cBusCode, cbarcode, cassunit, innum, inquantity, cSource, cWhCode,
cWhName, dDate, cCode, cRdCode, cRdName, cDepCode, cDepName, cPersonCode,
cPersonName, cSTCode, cSTName, cCusCode, cCusAbbName, cOrderCode,
cBillCode, cDLCode, cMaker, cHandler, cAccounter, cMemo, cbvencode, cvenname,
cItemCode, cName, cItem_class, id_1, cItemCName, cInvCode, cInvAddCode,
cInvName, cInvStd, cBatch, iNum, iInvExchRate, cInvM_Unit, iQuantity, iUnitCost,
iPrice, iPUnitCost, iPPrice, dVDate, cPosition, cReplaceItem, AutoID, cVouchCode,
ipurorderid, ipurarriveid, iproorderid, iarriveid, dVeriDate, isalebillid,
(CASE WHEN bpufirst = 1 THEN N'是' ELSE N'否' END) AS bpufirst, iMPoIds,
iCheckIds, imassdate, cmassunit, cInVouchCode, iId, iSoutQuantity, iSoutNum, VT_ID,
(CASE WHEN bIsSTQc = 1 THEN N'是' ELSE N'否' END) AS bIsSTQc, cChkCode,
dChkDate, cChkPerson, dARVDate, bGsp, cGspState, iDLsID, iSBsID, iEnsID,
iSendNum, iSendQuantity, gspcheck, cposname, cDefine1, cDefine2, cDefine3,
cDefine4, cDefine5, cDefine6, cDefine7, cDefine8, cDefine9, cDefine10, cDefine11,
cDefine12, cDefine13, cDefine14, cDefine15, cDefine16, cdefine22, cdefine23,
cdefine24, cdefine25, cdefine26, cdefine27, cDefine28, cDefine29, cDefine30,
cDefine31, cDefine32, cDefine33, cDefine34, cDefine35, cDefine36, cDefine37,
cInvDefine1, cInvDefine2, cInvDefine3, cInvDefine4, cInvDefine5, cInvDefine6,
cInvDefine7, cInvDefine8, cInvDefine9, cInvDefine10, cInvDefine11, cInvDefine12,
cInvDefine13, cInvDefine14, cInvDefine15, cInvDefine16, cFree1, cFree2, cFree3,
cFree4, cFree5, cFree6, cFree7, cFree8, cFree9, cFree10, ufts, ccusinvcode,
ccusinvname, cshipaddress, strcontractid, strcode, isoseq, csocode, igrossweight,
inetweight
FROM KCSaleOutList
WHERE dDate >= N'2007-01-01' AND ((1 > 0) AND (1 > 0)) AND (AutoId IN
(SELECT id
FROM tempdb..tmp12123177tmp)) AND cVouchType = N'32' AND isnull(bIsSTQc, 0)
<> 1 AND ISNULL(bPuFirst, 0) <> 1 AND ISNULL(bIAFirst, 0) <> 1
ORDER BY cdefine23 DESC