I have a VBA macro, and i wish to add the following SQL,,however being a newbie dont know how to break the query in the excel macro?,,this the query:
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
buting the whole thing in quotes dont work...!