We have a technician from a vendor we work with that was supposed to aide in a creation of a report. I sent him my version of the code and he sent back this?
SELECT
case when B4602200.BSSI_Tenant_Lease_Status = 2
then B4602200.NAME
else 'Vacant'
end as 'Name'
,case when B4602200.BSSI_Tenant_Lease_Status = 2
then B4602200.CUSTNMBR
else 'Vacant'
end as 'Customer Number'
,case when B4602200.BSSI_Tenant_Lease_Status = 2
then 'Active Lease'
else 'No Active Lease'
end as 'Lease Status'
,case when B4602200.BSSI_Tenant_Lease_Status = 2
then B4602200.BSSI_Lease_Execution_Dat
else 'Vacant'
end as 'Move In Date'
,tblUnit.UnitCode
,tblUnit.BedroomCount
,tblUnit.CurrentStatus
,tblProject.[Project Number]
,tblUnit.UnitStatus
,tblUnit.ClassificationType
,tblUnit.UnitHousingType
,tlkpCommunity.CommunityName
,Trim([ADDRESS1]) & ", " & Trim([CITY]) & ", " & Trim([STATE]) & " " & Trim([Zip]) AS TenantAddress
,tblUnit.UnitID
,tblUnit.CommunityID
FROM ((B4602200 INNER JOIN (tblUnit INNER JOIN tblProject ON tblUnit.ProjectID = tblProject.ProjectID)
ON B4602200.LOCNCODE = tblUnit.UnitCode)
INNER JOIN tlkpCommunity ON tblUnit.CommunityID = tlkpCommunity.CommunityID)
INNER JOIN RM00101 ON B4602200.CUSTNMBR = RM00101.CUSTNMBR
WHERE tblUnit.CurrentStatus = 'CRHA Use'
ORDER BY tblUnit.UnitCode
Posted by: wrmosca <wrmosca@comcast.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar