您好,想统计最近30天的行数,代码如下,可以运行,但每次运行后发现Table1表加载了30天内的所有数据,是否有办法只统计行数而不加载数据。谢谢!
Dim StartDate As Date = Date.Today().AddDays(-30)Dim cmdn As new SQLcommandcmdn.ccmdn.CommandText = "SELECT Count(*) From {Table1} where [日期] > '" & StartDate & "'"If cmdn.ExecuteScalar > 500 Then messagebox.show("累计完成目标500") ReturnEnd If