0
votes

I get the following error

Msg 4104, Level 16, State 1, Line 13
The multi-part identifier "OCS2.PackageType" could not be bound.

when trying to bound multiple times to a table, I can't see what the problem, can anyone help?

use osdp068a

select 
    AU1.UserName As XPSubmittedBy, PD.RegionName As XPRequestingRegion, 
    PD.BusinessGrpName As XPBusinessGroup, AU2.UserName As XPAppRequesterName, 
    AU3.UserName As XPAppOwner, AU4.UserName As XPUATOwner,
    AU5.UserName As W7SubmittedBy, PD.RegionName As W7RequestingRegion, 
    PD.BusinessGrpName As W7BusinessGroup, AU6.UserName As W7AppRequesterName, 
    AU7.UserName As W7AppOwner, AU8.UserName As W7UATOwner,
    PD.PackageCode, SUBSTRING(PD.PackageCode,6,6) AS Application_Packagecode_Version, 
    PD.LangCode, PD.LicencingMethod,
    OSC1.PackageType As PackageTypeXP, PD.InstallFilename As XPInstallInstructions, 
    PD.ReadMeFilename As XPReadMe,
    OCS2.PackageType As PackageTypeW7, PD.InstallFilename As W7InstallInstructions, 
    PD.ReadMeFilename As W7ReadMe
from 
    PackageDetail PD
/*XP*/
Join 
    aspnet_Users AU1 On PD.CreatedBy = AU1.UserId
Join 
    aspnet_Users AU2 On PD.ApplicationRequesterID = AU2.UserId
Join 
    aspnet_Users AU3 On PD.ApplicationOwnerID = AU3.UserId
Join 
    aspnet_Users AU4 On PD.UATOwnerID = AU4.UserID
/*W7*/
Join 
    aspnet_Users AU5 On PD.CreatedBy = AU5.UserId
Join
    aspnet_Users AU6 On PD.ApplicationRequesterID = AU6.UserId
Join 
    aspnet_Users AU7 On PD.ApplicationOwnerID = AU7.UserId
Join 
    aspnet_Users AU8 On PD.UATOwnerID = AU8.UserID
Left Outer Join 
    Region_CertifiedForPackage RC1 On PD.ID = RC1.PackageDetail_ID
Left Outer Join 
    OS_CerifiedForPackage OSC1 On PD.ID = OSC1.PackageDetail_ID AND OSC1.OSName_Certified = 'XP'
Left Outer Join 
    OS_CerifiedForPackage OSC2 On PD.ID = OSC2.PackageDetail_ID AND OSC2.OSName_Certified = 'WIN 7'
1

1 Answers

2
votes

Left Outer Join OS_CerifiedForPackage **OSC2**

You're trying to access OCS2. Just a simple typo :)