Find your form. To search, type in a keyword and/or choose a category. To search for archived forms from a previous tax year, choose a year in the drop down menu.
So don't worry so much about how to use  had had  as a unit of grammar, they will come together naturally when you want to express the verb ' to have ' in the past perfect. Let's consider a different verb for a moment like  to want .
Sub query version: yes you need to use a having clause after the Group by clause , as the where is just to filter the data on simple parameters , but group by followed by a Having statement is the idea to group the data and filter it on basis of some aggregate function......