我有以下代码:
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>
<%
%>
输出为:0。
当我在我的 sql-server 中运行查询时,结果是一个 > 15,000 的数字。
如何修复我的代码以显示与我在数据库中看到的相同的输出?