hoagieryder
MIS
I have multiple databases on a server that represent different companies data. I wrote an sql command, but when I "update datasource locations" when I want to run a report on a different database it allows me to update all of the tables being used, but not the command. Therefore any data that was being pulled from the command is that from the prior database not the one that I am trying to update it with. Is there anyway to update the command so it is run for the new database?
Here is the SQL Command:
SELECT
Old.acctNumber, Old.acctBalance, Old.maturityDate, Old.typeCode, Old.AvgRate, old.BankCode, {?asofdate}
FROM
(SELECT
acctNumber, acctBalance,maturityDate, typeCode, classCode, AvgRate, BankCode
FROM Deposit
WHERE asOfDate= {?oldasofdate})
AS OLD
LEFT OUTER JOIN
(SELECT
acctNumber
FROM Deposit
WHERE asOfDate={?asofdate})
AS new
ON OLD.acctNumber =new.acctNumber
WHERE new.acctNumber Is Null
AND OLD.maturityDate >{?asofdate}
Here is the SQL Command:
SELECT
Old.acctNumber, Old.acctBalance, Old.maturityDate, Old.typeCode, Old.AvgRate, old.BankCode, {?asofdate}
FROM
(SELECT
acctNumber, acctBalance,maturityDate, typeCode, classCode, AvgRate, BankCode
FROM Deposit
WHERE asOfDate= {?oldasofdate})
AS OLD
LEFT OUTER JOIN
(SELECT
acctNumber
FROM Deposit
WHERE asOfDate={?asofdate})
AS new
ON OLD.acctNumber =new.acctNumber
WHERE new.acctNumber Is Null
AND OLD.maturityDate >{?asofdate}