/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Help on a query

02/27/2020 262 views

Guys,


Can you help me to get a filter by date on this query?

I have a custom field to get the date about the hotfix was installed, I'd like to filter this query below by device where have installed the hotfix by more than 30 days (or 1 month).


I'd like to show the devices that have installed the hotfix more than 30 days.


here the query I have.


SELECT

M.NAME as 'System Name'

,(select replace(MCI.STR_FIELD_VALUE, "<br/>", "") from MACHINE_CUSTOM_INVENTORY MCI join SOFTWARE S on MCI.SOFTWARE_ID = S.ID where MCI.ID = M.ID and S.DISPLAY_NAME = "HotfixID") as 'HotfixID'

,(select replace(MCI.STR_FIELD_VALUE, "<br/>", "") from MACHINE_CUSTOM_INVENTORY MCI join SOFTWARE S on MCI.SOFTWARE_ID = S.ID where MCI.ID = M.ID and S.DISPLAY_NAME = "last date patched (date-fix)") as 'Last Date Patched'

FROM

MACHINE M

JOIN MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID) 

JOIN LABEL L ON (ML.LABEL_ID = L.ID)

WHERE 

L.NAME = 'LABEL_NAME_XXX' 

2 Comments   [ + ] Show comments

Comments

  • Could you explain why you are storing last date patched as custom inventory fields?
  • I raise the same question. It is my company needs...they want to know when the client have been patched, just the date is sufficient... now I'm stuck on this part hehehhee
    • What I mean is, why are you storing it in a custom field and not reporting based on patching information?

All Answers

0

Surely you just need to add to your WHERE statement when the last date patch date is greater than 30 days?

Answered 02/27/2020 by: Hobbsy
Red Belt

  • exactly!!! thanks to summarize... do you know how to do that? considering the return of the "last date patched (date-fix)" is M/D/YYYY
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ