I have the following code: 

```
sql="SELECT  COUNT(*) AS CurrentInvoice from [Invoices].[dbo].[InvoiceSentInformation] WHERE (InvoiceSeries = 18) AND (InvoicePeriodStartDate='"&SelectedMonth&"') AND (CustomerBillingGroupId IN (2, 3, 11))" 
Response.Write SelectedMonth
'Response.Write sql
r.open sql,c_SQL,3,3
IF r.recordcount>0 THEN
    CurrentInvoice=r("CurrentInvoice")
    for i=1 to r.recordcount
   %>
       <TR align="center">
        <TD><%=CurrentInvoice%></TD>
        <TD>
         <%

  %>

```

And the output is: 0.

When I run the query in my sql-server, the result is a number > 15,000.  

How can I fix my code to show the same output as I see in my database?