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: 381  
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 Deploy
by  CyberCitizen   Go to last post Go to first unread
Last post: 10/10/2019 2:31:27 AM(UTC)
Action Backup Computer with Disk2VHD to network share
by  pryan67  
Go to last post Go to first unread
Last post: 10/7/2019 3:36:05 PM(UTC)
Lansweeper Remote Registry 2019
by  Keywan   Go to last post Go to first unread
Last post: 9/30/2019 10:10:08 AM(UTC)
Lansweeper Patton SN4970
by  Randomusername  
Go to last post Go to first unread
Last post: 9/27/2019 6:33:45 PM(UTC)
Action Change Windows domain PC Name
by  max204   Go to last post Go to first unread
Last post: 9/19/2019 10:28:29 AM(UTC)
Lansweeper Launch PowerShell remote PSSession
by  Ian  
Go to last post Go to first unread
Last post: 9/9/2019 12:10:56 PM(UTC)
Action Remote print management
by  CyberCitizen   Go to last post Go to first unread
Last post: 9/4/2019 3:53:00 AM(UTC)
Lansweeper Infopath installer help
by  CyberCitizen  
Go to last post Go to first unread
Last post: 9/2/2019 8:18:06 AM(UTC)