SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 help query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kabon
Starting Member

Indonesia
48 Posts

Posted - 05/24/2013 :  04:27:16  Show Profile  Reply with Quote
I have query like this:

SELECT PD.RECID,
dbo.[f_ZeroLeading] ((ISNULL(convert(numeric(16,2),C.XMLRECORD.value('(/row/c22)[1]','NVARCHAR(100)')),'0'))
+(ISNULL(convert(numeric(16,2),C.XMLRECORD.value('(/row/c22 [@m=2])[1]','NVARCHAR(100)')),'0'))) AS OUTSTANDING_BAL
FROM FBNK_PD_CAPTURE as PD with (nolock)
left join FBNK_PD_PAYMENT_DUE C on PD.RECID COLLATE Latin1_General_100_BIN2 = (SELECT REPLACE(C.RECID COLLATE Latin1_General_100_BIN2 , 'PDLD','PDCA') FROM FBNK_PD_PAYMENT_DUE C WHERE C.RECID COLLATE Latin1_General_100_BIN2 LIKE 'PDLD%')

and have still error.
Do you have idea for this query?

bandi
Flowing Fount of Yak Knowledge

India
2210 Posts

Posted - 05/24/2013 :  05:28:09  Show Profile  Reply with Quote
Check whether you have returned more than one record for sub query ?
SELECT REPLACE(C.RECID COLLATE Latin1_General_100_BIN2 , 'PDLD','PDCA') FROM FBNK_PD_PAYMENT_DUE C WHERE C.RECID COLLATE Latin1_General_100_BIN2 LIKE 'PDLD%'

Let us know the result...
And also post us the error message

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000