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: 433  
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

Action Find lost space the easy way (spacesniffer.exe)
by  krozar   Go to last post Go to first unread
Last post: 5/5/2020 10:27:33 PM(UTC)
Lansweeper Querying a web server or web services
by  mmo  
Go to last post Go to first unread
Last post: 5/5/2020 9:00:36 PM(UTC)
Action Password Status
by  brodiemac-too   Go to last post Go to first unread
Last post: 4/23/2020 9:01:03 PM(UTC)
Action Email user
by  Michael Kop  
Go to last post Go to first unread
Last post: 4/7/2020 11:24:12 AM(UTC)
Lansweeper actualizacion de datos importando csv
by  jhon freddy   Go to last post Go to first unread
Last post: 3/31/2020 9:04:45 PM(UTC)
Lansweeper Asset Actions - RunAs Prompt
by  Socal_s197  
Go to last post Go to first unread
Last post: 3/26/2020 10:02:16 PM(UTC)
Lansweeper Remote Registry 2019
by  CyberCitizen   Go to last post Go to first unread
Last post: 3/6/2020 12:25:39 AM(UTC)
Lansweeper Installation Parameters
by  Florian_Eigsi  
Go to last post Go to first unread
Last post: 3/3/2020 10:17:18 AM(UTC)