Quantcast
Channel: Support Portal
Viewing all articles
Browse latest Browse all 20315

Re : is in contract report

$
0
0
Hi Rod,

You could use the query below to generate the report to list the asset lease details.

SELECT MAX(productType.COMPONENTTYPENAME) "Product Type",MAX(resource.RESOURCENAME) "Asset Name",MAX(product.COMPONENTNAME) "Product",MAX(state.DISPLAYSTATE) "Asset State",MAX(aaaUser.FIRST_NAME) "User",  longtodate(max(ResourceLease.STARTTIME)) "Lease Start Date",longtodate(max(ResourceLease.ENDTIME)) "Lease End Date", case when ResourceOwnerHistory.ISLEASED=1 then 'True' ELSE 'False' END "Is Leased" FROM Resources resource LEFT JOIN ComponentDefinition product ON resource.COMPONENTID=product.COMPONENTID LEFT JOIN ComponentType productType ON product.COMPONENTTYPEID=productType.COMPONENTTYPEID LEFT JOIN ResourceState state ON resource.RESOURCESTATEID=state.RESOURCESTATEID LEFT JOIN ResourceOwner rOwner ON resource.RESOURCEID=rOwner.RESOURCEID LEFT JOIN ResourceAssociation rToAsset ON rOwner.RESOURCEOWNERID=rToAsset.RESOURCEOWNERID LEFT JOIN SDUser sdUser ON rOwner.USERID=sdUser.USERID LEFT JOIN AaaUser aaaUser ON sdUser.USERID=aaaUser.USER_ID LEFT JOIN ResourceLease ON resource.RESOURCEID=ResourceLease.RESOURCEID LEFT JOIn ResourceOwnerHistory ON resource.RESOURCEID=ResourceOwnerHistory.RESOURCEID GROUP BY resource.RESOURCEID,ResourceOwnerHistory.ISLEASED order by 1

Regards,
Stephen

Viewing all articles
Browse latest Browse all 20315

Trending Articles