Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2012-03-12 : 04:56:31
|
Hii am running one query in ssms 2008.i have used 4 subquery in my main queryone of subquery is like this wayleft join (select distinct count(FBH.BILL_ID) as id, MAX(FBH.vfd_bod_Date) as date1 , FBM.PARTY_CODE ,FBM.BILL_PARAM_TYPE, FBH.BP_LIAB_CRNCY from dwh_staging..FBH inner join dwh_staging..FBM on FBM.BILL_ID =FBH.BILL_ID where fbh.bill_stat in ('R')--and FBM.PARTY_CODE ='10125003' --and FBM.PARTY_CODE ='25041777' group by FBM.BILL_PARAM_TYPE , fbm.party_code,FBH.DUE_DATE ,FBH.BILL_ID, FBH.BP_LIAB_CRNCY having MAX(FBH.vfd_bod_Date)>FBH.DUE_DATEin above sub query i have used count(biil_id) and max(vfd_bod_Date)columns i am running my subquery its working fine where i run ENTIRE QUERYI am getting this type errorMsg 245, Level 16, State 1, Line 1Conversion failed when converting the nvarchar value '721A17111214001' to data type int.can anobody know the solution pls help mecount of bill_id may be returning multiple valuesmohan |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-03-12 : 06:48:38
|
So you are showing us what "is working fine" and not what is giving the error??? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|