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
 General SQL Server Forums
 New to SQL Server Programming
 Subselect with COALESCE function in SQLServer 2000

Author  Topic 

Shelly_john2000
Starting Member

1 Post

Posted - 2009-06-23 : 00:05:08
UPDATE PS_AM_FV_RPT_STG
SET FV_BEGIN = %Coalesce( (SELECT B.FMV FROM PS_AM_FMV B WHERE B.BUSINESS_UNIT = PS_AM_FV_RPT_STG.BUSINESS_UNIT AND B.ASSET_ID = PS_AM_FV_RPT_STG.ASSET_ID AND B.EFFDT = (SELECT MAX(X.EFFDT) FROM PS_AM_FMV X WHERE X.BUSINESS_UNIT = B.BUSINESS_UNIT AND X.ASSET_ID = B.ASSET_ID AND X.EFFDT <= %DATEIN(%Bind(AM_FV_RPT_AET.FROM_DATE))) AND B.EFFSEQ = (SELECT MAX(Y.EFFSEQ) FROM PS_AM_FMV Y WHERE Y.BUSINESS_UNIT = B.BUSINESS_UNIT AND Y.ASSET_ID = B.ASSET_ID AND Y.EFFDT = B.EFFDT) ) , 0)
WHERE PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE)

Subselect with COALESCE function in SQLServer 2000 is not working.The program abends with [SQL Server]Internal SQL Server error. (SQLSTATE 37000) 8624. Can anybody help me with an alternative

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-06-23 : 07:50:05
That doesn't look like MS SQL Server code. '%' is used in wildcard searches, BIND and DATEIN are not functions in SQL Server.

Jim
Go to Top of Page
   

- Advertisement -