Link to an example.
On the total tab, I have:
=QUERY(data!1:963, "SELECT COUNT(B), SUM(C), SUM(D) where G > date '"&TEXT(F2,"yyyy-mm-dd")&"' and G <= date '"&TEXT(G2,"yyyy-mm-dd")&"'", 1)
However, I want to only count the unique items in B that fall between the date range selected. I Tried to use COUNT(DISTINCT B) but google sheets doesn't seem to like that.