troubleshooting Question

query to MS SQL

Avatar of marrowyung
marrowyung asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
15 Comments2 Solutions266 ViewsLast Modified:
Dear all,

right now I tried to run the query from Oracle and this orace talk to MSSQL:

select "BeginDate",t.CRCYID, t."CurrencyAbbrv", "ExchangeRate" from
        (
        select a."CurrencyID" "CRCYID", "CurrencyAbbrv", max (b."BeginDate") "CRCYDATE"
         from
            dbo.tbCurrency@LINK_TELARIX_IXCORE_MAIN.GATEWAYCOMMS.COM a,
            dbo.tbExchange@LINK_TELARIX_IXCORE_MAIN.GATEWAYCOMMS.COM b
        where
            a."CurrencyID"=b."CurrencyID" and b."BeginDate" <= to_date(vDay,'YYYYMMDD')
        group by
            a."CurrencyID","CurrencyAbbrv"    
        ) t, dbo.tbExchange@LINK_TELARIX_IXCORE_MAIN.GATEWAYCOMMS.COM u
        where t.crcyid=u."CurrencyID" and t.crcydate=u."BeginDate" );


Question now is :

1) to_date(vDay,'YYYYMMDD') is not understand by the MS SQL, how can I replace it using it by today’s date in the MSSQL notation ?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros