9 Replies Latest reply on Dec 19, 2012 7:49 AM by v.taillet

    How to report failed computer of a task

    v.taillet Apprentice

      Hello,

       

      I try to make a report of failed computers on a scheduled tasks, but i'm not comfortable with SQL

       

      I'm just able to have this !!

       

      SELECT [LD_TASK_IDN]
            ,[TASK_NAME]
            ,[LAST_START]
            ,[LAST_END]
            ,[LAST_STATUS]
        FROM [dbms].[dbo].[LD_TASK]
        where TASK_NAME='My scheduled task'

       

      ***

       

      SELECT [Query_Idn]
            ,[Name]
            ,[Filter]
            ,[LastResolvedDate]
        FROM [dbms].[dbo].[Query]
        where Name='My query'

       

       

      But how to have the list of computers which failed ?

       

      Thanks

        • 1. Re: How to report failed computer of a task
          LANDeskWizrd SSMMVPGroup

          This migh help

           

          SELECT computer.devicename, ld_task.LD_TASK_IDN, ld_task.TASK_NAME, ld_task.LAST_START, ld_task.LAST_END, ld_task.LAST_STATUS
          FROM ld_task
          inner join ld_task_machine on ld_task_machine.ld_task_idn = ld_task.ld_task_idn
          inner join computer on ld_task_machine.computer_idn = computer.computer_idn
          where ld_task_machine.mac_status = '3' and ld_task.task_name = 'My scheduled task'

          1 of 1 people found this helpful
          • 2. Re: How to report failed computer of a task
            v.taillet Apprentice

            Thanks, it's good !

             

            SELECT computer.devicename, ld_task.TASK_NAME, ld_task.LAST_START, ld_task.LAST_END, ld_task_machine.mac_status,
            FROM ld_task
            inner join ld_task_machine on ld_task_machine.ld_task_idn = ld_task.ld_task_idn
            inner join computer on ld_task_machine.computer_idn = computer.computer_idn
            where ld_task_machine.mac_status <> '2' and ld_task.task_name = 'My_Task'

             

            I try to have the 'ReturnCodeMapping.EnuDescription', so I try (like you solution) to "inner join" ReturnCodeMapping, but I can't find jonction to have this information.

            I think that i should link 'ReturnCodeMapping.ReturnCodeTemplate_Idn' (unique ID), but where ?

             

            Thanks !

            • 3. Re: How to report failed computer of a task
              v.taillet Apprentice

              Hello,

               

              Do you have the solution for having the error description ?

               

              Thanks

              • 4. Re: How to report failed computer of a task
                Catalysttgj Expert

                This is what i'm coming up with to get to something like what you might be after. There's a few problems that i'm seeing though with this information overall.

                First, the mac_status value of 0 is probably not a desired one to have in your list since this is the value that devices that have not actually performed a task seem to bet set to. I filtered those in the query below.

                Second there's a mac_status value of 10 that you might see in your tasks, and this value i'm uncertain what it is yet, but i see it for devices that are not even associated to a task anymore in our system. So you might want to filter those too. Not sure.

                Third, ReturnCodeMapping does not contain every returncode that appears within tasks, so this information is spotty at best. Not sure if you can easily add to the ReturnCodeMapping table, but i'll leave that to you to figure out. Because of this nature of the information, I used "Left outer join" to attach this table, so that you won't get any drops from a lack of a return code. This will mean that you'll see "NULL" in this column output if there is no matching value in the table, so I also added the Mac_retcode column to the output so that you can see which codes are associated to a task that are not in the returncodemapping table. Also, the column for the returncode is nvarchar, since it has the possiblity of containing text as well as numbers, but Mac_retcode is an int, so i cast both of them to varchar(10), so that they can be evaluated against each other. You want to watch this. If a returncode was longer than 10 characters this could cause an issue. You could easily increase this if needed.

                Additionally, I aliased all the tables in this query. It makes it much shorter to code it. If you're new to SQL, this could be the epiphany for the day. :-) See below:

                 

                 

                SELECT
                c.devicename,
                t.TASK_NAME,
                t.LAST_START,
                t.LAST_END,
                m.mac_status,
                m.mac_retcode,
                r.EnuDescription
                FROM
                ld_task as t inner join
                ld_task_machine as m on m.ld_task_idn = t.ld_task_idn inner join
                computer as c on c.computer_idn = m.computer_idn left outer join
                ReturnCodeMapping as r on cast(r.ReturnCode as varchar(10)) = cast(m.mac_retcode as varchar(10))
                where m.mac_status <> '2' and m.mac_status <> '0' and t.task_name like 'My Task'
                order by m.mac_status
                Hope it helps!
                • 5. Re: How to report failed computer of a task
                  Catalysttgj Expert

                  Okay, forget ReturnCodeMapping. Its most likely worthless to ya. I played some more with this and came up with what is more likely the thing you're after. Try this out instead:

                   

                  SELECT
                  c.devicename,
                  t.TASK_NAME,
                  t.LAST_START,
                  t.LAST_END,
                  m.mac_status,
                  m.mac_retcode,
                  d.message
                  FROM
                  ld_task as t inner join
                  ld_task_machine as m on m.ld_task_idn = t.ld_task_idn inner join
                  computer as c on c.computer_idn = m.computer_idn left outer join
                  ld_message as d on d.mac_retcode = m.mac_retcode
                  where m.mac_status <> '2' and m.mac_status <> '0'
                  order by m.mac_status
                  • 6. Re: How to report failed computer of a task
                    Catalysttgj Expert

                    Also i think you will want to filter out the 10's, as I don't think they're useful information. I see too many of them when i run the query, so i expect they are not true failures. I've added it below:

                     

                     

                    SELECT
                    c.devicename,
                    t.TASK_NAME,
                    t.LAST_START,
                    t.LAST_END,
                    m.mac_status,
                    m.mac_retcode,
                    d.message
                    FROM
                    ld_task as t inner join
                    ld_task_machine as m on m.ld_task_idn = t.ld_task_idn inner join
                    computer as c on c.computer_idn = m.computer_idn left outer join
                    ld_message as d on d.mac_retcode = m.mac_retcode
                    where m.mac_status <> '0' and m.mac_status <> '2' and m.mac_status <> '10'
                    order by m.mac_status
                    Good luck!
                    • 7. Re: How to report failed computer of a task
                      v.taillet Apprentice

                      Hello,

                       

                      I tried this :

                       

                      SELECT

                      c.devicename,

                      t.TASK_NAME,

                      t.LAST_START,

                      t.LAST_END,

                      m.mac_status,

                      rcm.EnuDescription

                      FROM ld_task as t

                      join ld_task_machine as m on m.ld_task_idn = t.ld_task_idn

                      join computer as c on c.computer_idn = m.computer_idn

                      join PACKAGE as p on t.PACKAGE_IDN = p.PACKAGE_IDN

                      join ReturnCodeTemplate as rct on p.ReturnCodeTemplate_Idn = rct.ReturnCodeTemplate_Idn

                      join ReturnCodeMapping as rcm on rct.ReturnCodeTemplate_Idn = rcm.ReturnCodeTemplate_Idn

                      where m.mac_status <> '2' and m.mac_status <> '0' and t.task_name like 'Modules_ELearning_FR_1.0.0_Install'

                      order by c.DeviceName

                       

                       

                      The result is not exactly what i want because the computer appears 7 times, but i only want the result of the task !! (so one line for each devicename with the last result).

                      It's normal because mac_status and enudescription are not "linked" :

                       

                      devicenameTASK_NAMELAST_STARTLAST_ENDmac_statusEnuDescription
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CDO201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CM0501Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMAI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003La copie s'est bien déroulée
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Erreur serieuse : aucune copie de fichier
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Quelques fichiers n'ont pas été copiés : à vérifier
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Quelques erreurs de copie, à vérifier
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003De nouveaux fichiers ont été détectés : à vérifier
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Package deployment failed
                      CMB301Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Copie OK
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMBX01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMCI01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMLL01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMLM01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMPU01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMQY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMT601Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMTR01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003La copie s'est bien déroulée
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Erreur serieuse : aucune copie de fichier
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Quelques fichiers n'ont pas été copiés : à vérifier
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Quelques erreurs de copie, à vérifier
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003De nouveaux fichiers ont été détectés : à vérifier
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Package deployment failed
                      CMTY01Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0003Copie OK
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007La copie s'est bien déroulée
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Erreur serieuse : aucune copie de fichier
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques fichiers n'ont pas été copiés : à vérifier
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Quelques erreurs de copie, à vérifier
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007De nouveaux fichiers ont été détectés : à vérifier
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Package deployment failed
                      CMV201Modules_ELearning_FR_1.0.0_Install2012-12-17 22:00:00.0002012-12-17 22:50:18.0007Copie OK

                       

                       

                      What is the table containing the text result for mac_status (ex : failed, success, etc) ?

                       

                      Thanks

                      • 8. Re: How to report failed computer of a task
                        Apprentice

                        The status descriptions do not exist in a table. They are on this page...

                        http://community.landesk.com/support/docs/DOC-1804

                         

                        Here is an example query that I use...

                         

                        select A0.Displayname as "Computer Name",

                                  'Task Status' = Case

                                  WHEN A2.MAC_STATUS = '0' THEN 'Waiting'

                                  WHEN A2.MAC_STATUS = '1' THEN 'Working'

                                  WHEN A2.MAC_STATUS = '2' THEN 'Done'

                                  WHEN A2.MAC_STATUS = '3' THEN 'Failed'

                                  WHEN A2.MAC_STATUS = '4' THEN 'Active'

                                  WHEN A2.MAC_STATUS = '5' THEN 'FAILED_DONTRETRY'

                                  WHEN A2.MAC_STATUS = '6' THEN 'Invalid'

                                  WHEN A2.MAC_STATUS = '7' THEN 'Unreachable'

                                  WHEN A2.MAC_STATUS = '8' THEN 'Canceled'

                                  WHEN A2.MAC_STATUS = '9' THEN 'Busy'

                                  WHEN A2.MAC_STATUS = '10' THEN 'Delayed'

                                  END,

                                  CONVERT(varchar, STATUS_TIME, 101) as "Status Date",

                                  CONVERT(varchar, LastUpdInvSvr, 101) as "Last Inventory Update"

                                   from Computer A0

                        LEFT OUTER JOIN LD_TASK_MACHINE A2 ON A0.Computer_Idn = A2.COMPUTER_IDN

                        LEFT OUTER JOIN LD_TASK A1 ON A1.LD_TASK_IDN = A2.LD_TASK_IDN

                              WHERE A1.TASK_NAME = 'Microsoft Office 2010 Student'

                        order by [Task Status], STATUS_TIME DESC

                        • 9. Re: How to report failed computer of a task
                          v.taillet Apprentice

                          It's not exactly what i wanted (i want to have returncodemapping.enudescription, but i'm not able to find it), so i will use the above method (when...then...)

                           

                          Thanks