/build/static/layout/Breadcrumb_cap_w.png

Help on a query

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
  • Could you explain why you are storing last date patched as custom inventory fields? - chucksteel 4 years ago
  • 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 - scoterland 4 years ago
    • What I mean is, why are you storing it in a custom field and not reporting based on patching information? - chucksteel 4 years ago

Answers (1)

Posted by: Hobbsy 4 years ago
Red Belt
0

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


Comments:
  • 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 - scoterland 4 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
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