title: SQL in VBA Function
body: <p>I have a VBA Function, and I want to add the following SQL, however being a newbie I don't know how to break the query in the code.</p>
  
  <p>The query:</p>
  
  <pre><code> strSQL = "select (SELECT COUNT (DISTINCT CUSTOMER_ACCOUNT.ID) AS NUMBER_OF_ACCOUNTS_NOT_DELETED FROM       CUSTOMER_ACCOUNT INNER JOIN
  ACCOUNT ON CUSTOMER_ACCOUNT.ACCOUNT_ID=ACCOUNT.ID
   WHERE
  Convert(datetime,convert(char(10),[CUSTOMER_ACCOUNT].CREATED_ON,101))
  BETWEEN '2009-01-01' AND '2009-12-31' AND  CUSTOMER_ACCOUNT.DELETED!='1' AND      ACCOUNT.DELETED !='1'
  )
  -
  (SELECT    COUNT (DISTINCT dLOAD_ACCOUNT_DETAIL.ACCOUNT_NUMBER) AS NOT_ACTIVE_ACCOUNTS
  
  FROM         dbo.LOAD_ACCOUNT_DETAIL LEFT OUTER JOIN
                    ACCOUNT ON dbo.LOAD_ACCOUNT_DETAIL_0.ID = dbo.ACCOUNT.ID WHERE
  ACCOUNT_STATUS !='1') AS DIFFERENCE 
  </code></pre>
  
  <p>buting the whole thing in quotes dont work...!</p>