AnsweredAssumed Answered

ExecuteSQL for finding sum between date range

Question asked by sabremm on May 11, 2018
Latest reply on Oct 23, 2018 by sabremm

I am trying to use ExecuteSQL to find sum of items between two dates.  I got help from online experts but I don't seem to get the desired result when I change variables to my set of variables.  I am new to ExecuteSQL so I would appreciate if someone can point the wrong syntax or search criteria:



ExecuteSQL ( "SELECT SUM (Quantity) FROM ITEMS WHERE id = ? AND POs.Date >= ? AND POs.Date <= ? " ;

                       "" ; "" ;; BeginDate; EndDate


POs and ITEMS are tables linked by Parent-Child relationship through a portal.  A given PO can have multiple ITEMS, and I had to insert POs.Date since ITEMS table does not have date, but only product name, quantity, and other factors.