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

Lansweeper Edit Work Time Enhancements
by  pipapo   Go to last post Go to first unread
Last post: Yesterday at 3:41:25 PM(UTC)
Lansweeper software authorization based on "name" AND "version"
by  deejay3670  
Go to last post Go to first unread
Last post: Yesterday at 2:53:28 PM(UTC)
Lansweeper HP Warranty scan - broken for some products
by  JérômeS   Go to last post Go to first unread
Last post: Yesterday at 2:34:13 PM(UTC)
Lansweeper Helpdesk Report for unresolved tickets
by  Walter  
Go to last post Go to first unread
Last post: Yesterday at 2:08:39 PM(UTC)
Lansweeper Certificate status & end dates
by  Antoine EVRARD   Go to last post Go to first unread
Last post: Yesterday at 1:01:37 PM(UTC)
Lansweeper Assign switch port to location map
by  cycleheat  
Go to last post Go to first unread
Last post: 5/26/2020 5:21:54 PM(UTC)
Lansweeper Email Link back to ticket
by  TruckDriverTurnedIT   Go to last post Go to first unread
Last post: 5/26/2020 5:20:08 PM(UTC)
Lansweeper LSAgent not Scanning or Reporting all Software
by  cycleheat  
Go to last post Go to first unread
Last post: 5/26/2020 4:15:05 PM(UTC)