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: 466  
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 Report on Specific list of Workstations
by  RC62N   Go to last post Go to first unread
Last post: 9/18/2020 5:00:11 PM(UTC)
Lansweeper External Monitor Report
by  RC62N  
Go to last post Go to first unread
Last post: 9/18/2020 4:49:03 PM(UTC)
Lansweeper Assets Used by User
by  dirtworks500   Go to last post Go to first unread
Last post: 9/18/2020 1:38:04 AM(UTC)
Lansweeper Adding Custom Tags to Reports
by  RC62N  
Go to last post Go to first unread
Last post: 9/17/2020 8:23:33 PM(UTC)
Lansweeper Server Info Report
by  Xaerie   Go to last post Go to first unread
Last post: 9/16/2020 11:36:22 PM(UTC)
Lansweeper Update existing Billing Report
by  Jose Da Silva  
Go to last post Go to first unread
Last post: 9/16/2020 12:41:42 PM(UTC)
Lansweeper reporting on scheduled tasks
by  Hendrik.VE   Go to last post Go to first unread
Last post: 9/16/2020 8:23:44 AM(UTC)