SQL 2000 Query?


I'd like to know if this Query is based on Ansi-89.
If the query is old:  how I could change to ANSI-92?

SELECT  tUseOCode = left((SELECT IsNull(InstTSigla,InstTDescrip) + '-' + IsNull(UorgTSigla,UOrgTDescrip) + '-' + IsNull(PerTDescrip,'')
                              FROM   oeimInstitucion a, oeimUnidOrg b, SIUsuario c, oeimPersonal d
                             WHERE c.UsrCCod = M.cUseOCode
                               AND c.UsrCCodper = d.PerCCod
                               AND d.PerCCoduorg = b.UorgCCod
                               AND b.UorgCCodInst = a.InstCCod), 100),
          convert(varchar(10),M.dRegiDate,103) + ' ' + convert(varchar,M.dRegiDate,108) as dRegiDate
     FROM Movimiento M
    order By M.cMoviCode desc

Open in new window

I'd really appreciate your help.
JnavarroMcIT ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:

SELECT  LEFT((  SELECT  ISNULL(InstTSigla,InstTDescrip) + '-' + ISNULL(UorgTSigla,UOrgTDescrip) + '-' + ISNULL(PerTDescrip,'')
                FROM    SIUsuario c
                    INNER JOIN oeimPersonal d ON c.UsrCCodper = d.PerCCod
                    INNER JOIN oeimUnidOrg b ON d.PerCCoduorg = b.UorgCCod
                    INNER JOIN oeimInstitucion a ON b.UorgCCodInst = a.InstCCod
                WHERE c.UsrCCod = M.cUseOCode
            ), 100) AS tUseOCode,
        CONVERT(VARCHAR(10),M.dRegiDate,103) + ' ' + CONVERT(VARCHAR,M.dRegiDate,108) AS dRegiDate
FROM Movimiento M

Open in new window

But you should use the table alias name for all columns.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
CONVERT isn't an ANSI function, so your query won't run in another DBMS besides SQL Server.
To answer your question, the query is neither ANSI-89 nor ANSI-92 compatible.
JnavarroMcIT ConsultantAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.