Notification

Icon
Error

Model Year Report - Assigning a Date to Model

Posted: Tuesday, October 8, 2019 4:25:21 PM(UTC)
MHScripts

MHScripts

Member Original PosterPosts: 12
0
Like
Hello,
I want to create a report that basically looks at the model of a machine and assigns a date to it in a custom column.

I am wondering if I could create a custom table or something within LS that would basically have:
Model1 – 2011
Model2 – 2012
Etc.

Or would there be a better way to do this?

Thanks!

RC62N
#1RC62N Member Posts: 477  
posted: 10/9/2019 4:21:40 PM(UTC)
If your list isn't too long, you could set up a CASE statement to output the model year.
Code:
SELECT
   ...
  CASE
    WHEN tblAssetCustom.Model IN ('OptiPlex 7010', 'OptiPlex 9010')
         OR tblAssetCustom.Model LIKE 'Latitude E6530%' THEN 2012
    WHEN tblAssetCustom.Model = 'OptiPlex 7020' THEN 2014
    WHEN tblAssetCustom.Model = 'OptiPlex 7040' THEN 2015
    WHEN tblAssetCustom.Model = 'OptiPlex 7050' THEN 2018
    WHEN tblAssetCustom.Model LIKE 'Latitude 6540' THEN 2013
    etc.
  END AS [model year]
  ...
FROM
  ...

Active Discussions

Lansweeper Assets with different MACs/IPs getting merged
by  MartinO   Go to last post Go to first unread
Last post: Yesterday at 3:15:25 PM(UTC)
Lansweeper Where is Extension Attribute 1
by  CoolDood  
Go to last post Go to first unread
Last post: 10/22/2020 8:45:46 PM(UTC)
Lansweeper Accessing IMEI/MEID fields for manual assets
by  Tom Londe   Go to last post Go to first unread
Last post: 10/22/2020 5:31:27 PM(UTC)
Lansweeper Server 2019 Version Numbers
by  MCBowman   Go to last post Go to first unread
Last post: 10/22/2020 2:35:32 PM(UTC)
Lansweeper Wake on Lan Issues
by  brodiemac-too  
Go to last post Go to first unread
Last post: 10/21/2020 4:48:10 PM(UTC)