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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 CONVERSOIN ISSUE IN SQL SERVER

Author  Topic 

kond.mohan
Posting Yak Master

213 Posts

Posted - 2012-03-07 : 09:26:51


HI


left join (select 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

left join dwh_staging..FBM on FBM.BILL_ID =FBH.BILL_ID

where fbh.bill_stat in ('R') and FBM.PARTY_CODE ='25041777'

group by FBH.BILL_ID,
FBM.BILL_PARAM_TYPE ,
fbm.party_code,FBH.DUE_DATE ,
FBH.BP_LIAB_CRNCY
having MAX(FBH.vfd_bod_Date)>FBH.DUE_DATE


THIS IS MY SUBQUERY

I NEED COUNT OF ID COLUMN IN MY MAIN QUERY
SAME THIS KIND OF QUERIS ARE EXECUTED BASED ON DIFFERENT CRITERIA(ACTIVE,CLOSED,CRYSTLISED..)IN MY MAIN QUERY

WHEN I CALLED THIS COUNT(ID) COLUMN IN MY MAIN QUERY I AM GETTING THIS ERROR

Conversion failed when converting the nvarchar value '812D57111210002' to data type int.



PLS HELP ME

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-07 : 09:31:39
Please post the DDL of your tables, sample data in DML form and the expected results.

Read the hint link in my sig


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -