|
|
Archives of the TeradataForum
Message Posted: Wed, 28 Apr 2010 @ 13:36:44 GMT
Subj: | | Convert Access IIF to Teradata |
|
From: | | Jonas, Pete |
Good morning, Iam trying to convert some Access code to Teradata SQL. The Access code uses the iif keyword. Does anyone have any idea how to
rewrite this?Following is the select as it exists in Access
SELECT TPTABLES_iSEEKSchoolCrosswalk.iSEEKSchoolID,
CRTABLES_CRProgramMeasureNew.ProgramCode,
CRTABLES_CRProgramMeasureNew.ProgramTitle,
CRTABLES_CRProgramMeasureNew.AwardCode,
WIATABLES_WIACertificationOld.WIACertificationFlag,
IIf([AggregationCode]="M","Y","N") AS AggregationFlag,
IIf([ProgramGraduateCount]<6,1,[ProgramGraduateCount]) AS PGC,
IIf([ProgramGraduateCount]<6,Null,[SupplementalEPRate]) AS EPR,
IIf([ProgramGraduateCount]<6,Null,[SupplementalEPRCount]) AS EPRC,
IIf([GWCount]<6,Null,[GraduateWages]) AS GW, IIf([GWCount]<6,1,[GWCount]) AS GWC,
IIf([EPRCount]<6,Null,[EmploymentRetentionRate]) AS ERR,
IIf([EPRCount]<6,Null,[ERRCount]) AS ERRN, IIf([EPRCount]<6,1,[EPRCount]) AS ERRD,
IIf([RGWCount]<6,Null,[RetainedGraduateWages]) AS RGW,
IIf([RGWCount]<6,1,[RGWCount]) AS RGWC,
IIf([TYRRDenominator]<6,Null,[TwoYearRetentionRate]) AS TYRR,
IIf([TYRRDenominator]<6,Null,[TYRRNumerator]) AS TYRRN,
IIf([TYRRDenominator]<6,1,[TYRRDenominator]) AS TYRRD,
IIf([TYGWCount]<6,Null,[TwoYearGraduateWages]) AS TYGW,
IIf([TYGWCount]<6,1,[TYGWCount]) AS TYGWC, CRTABLES_CRProgramMeasureNew.SupplementalFlag,
CRTABLES_CRProgramMeasureNew.ICRNumerator,
CRTABLES_CRProgramMeasureNew.ICRDenominator,
CRTABLES_CRProgramMeasureNew.RelatedEmploymentRate,
CRTABLES_CRProgramMeasureNew.RERNumerator,
CRTABLES_CRProgramMeasureNew.RERDenominator,
CRTABLES_CRProgramMeasureNew.TotalTuition, CRTABLES_CRProgramMeasureNew.FY FROM
(TPTABLES_iSEEKSchoolCrosswalk INNER JOIN CRTABLES_CRProgramMeasureNew ON
(TPTABLES_iSEEKSchoolCrosswalk.CampusID =
CRTABLES_CRProgramMeasureNew.CampusID) AND (TPTABLES_iSEEKSchoolCrosswalk.InstitutionID =
CRTABLES_CRProgramMeasureNew.InstitutionID)) INNER JOIN WIATABLES_WIACertificationOld ON
(CRTABLES_CRProgramMeasureNew.AwardCode =
WIATABLES_WIACertificationOld.AwardCode) AND (CRTABLES_CRProgramMeasureNew.ProgramTitle =
WIATABLES_WIACertificationOld.ProgramTitle) AND (CRTABLES_CRProgramMeasureNew.ProgramCode =
WIATABLES_WIACertificationOld.ProgramCode) AND
(CRTABLES_CRProgramMeasureNew.InstitutionID =
WIATABLES_WIACertificationOld.InstitutionID)
ORDER BY TPTABLES_iSEEKSchoolCrosswalk.iSEEKSchoolID;
Any assistance would be greatly appreciated.
| |