Shamaila.Yousaf Posted January 17, 2021 Share Posted January 17, 2021 I would like to create a widget to show the number of loan requests from those who answered Yes that they are self isolating. Currently the answer is not assigned to a custom field. The number being shown is not correct as the 'Yes' also picks up from other questions asked. Please see details attached. Thanks in advance all. Sxx Link to comment Share on other sites More sharing options...
Shamaila.Yousaf Posted February 10, 2021 Author Share Posted February 10, 2021 Can someone kindly assist me with this one please? Thanks Sxx Link to comment Share on other sites More sharing options...
HHH Posted February 10, 2021 Share Posted February 10, 2021 try changing to WHERE h_answer='Yes' AND h_question_id = [put the ID of the question field here] 1 Link to comment Share on other sites More sharing options...
Shamaila.Yousaf Posted February 10, 2021 Author Share Posted February 10, 2021 Thanks @HHH, would the question id be the Field ID? Link to comment Share on other sites More sharing options...
HHH Posted February 12, 2021 Share Posted February 12, 2021 On 2/10/2021 at 1:01 PM, Shamaila.Yousaf said: Thanks @HHH, would the question id be the Field ID? I am 90% sure it is. But give it a test Link to comment Share on other sites More sharing options...
Shamaila.Yousaf Posted February 16, 2021 Author Share Posted February 16, 2021 Thanks @HHH "Query execution error' occurs. Link to comment Share on other sites More sharing options...
Victor Posted February 16, 2021 Share Posted February 16, 2021 @Shamaila.Yousaf can you copy/paste here the whole WHERE clause please? 1 Link to comment Share on other sites More sharing options...
Shamaila.Yousaf Posted February 18, 2021 Author Share Posted February 18, 2021 Thanks @Victor (h_requesttype='service request') AND (h_catalog= 'student laptop loan request') AND (h_datelogged BETWEEN '2021-01-30' AND '2021-08-31') AND h_pk_reference IN(SELECT h_entity_ref FROM h_itsm_questions WHERE h_answer ='Yes') AND h_question_id ='coronavirusloanrequest' Link to comment Share on other sites More sharing options...
Victor Posted February 18, 2021 Share Posted February 18, 2021 @Shamaila.Yousaf you closed the bracket too soon... (h_requesttype='service request') AND (h_catalog= 'student laptop loan request') AND (h_datelogged BETWEEN '2021-01-30' AND '2021-08-31') AND h_pk_reference IN (SELECT h_entity_ref FROM h_itsm_questions WHERE h_answer = 'Yes' AND h_question_id ='coronavirusloanrequest') 1 Link to comment Share on other sites More sharing options...
Victor Posted February 18, 2021 Share Posted February 18, 2021 ... also, not sure about that date logged... you might need to specify the timestamp as well.. BETWEEN '2021-01-30 00:00:00' AND '2021-08-31 00:00:00' 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now