字段:
Provider(供应商),Money(金额),Date(录入日期)输入框:
txtProvider(供应商),txtBuyDate1(开始时段),txtBuyDate2(结束时段)要求:
统计供应商配件供应额
使用:
shbSqlStr="select sum([Money]) as [Money] from PeiJianManage where Provider like '"
+ txtProvider.Value.ToString().Trim() + "' and [Date] > "
+ txtBuyDate1.Value.ToString().Trim() + " and "
+ txtBuyDate1.Value.ToString().Trim() + " < "
+ txtBuyDate2.Value.ToString().Trim() + " group by Provider ";
输入框有值时:
没有错误,但统计为空!!!
Provider(供应商),Money(金额),Date(录入日期)输入框:
txtProvider(供应商),txtBuyDate1(开始时段),txtBuyDate2(结束时段)要求:
统计供应商配件供应额
使用:
shbSqlStr="select sum([Money]) as [Money] from PeiJianManage where Provider like '"
+ txtProvider.Value.ToString().Trim() + "' and [Date] > "
+ txtBuyDate1.Value.ToString().Trim() + " and "
+ txtBuyDate1.Value.ToString().Trim() + " < "
+ txtBuyDate2.Value.ToString().Trim() + " group by Provider ";
输入框有值时:
没有错误,但统计为空!!!
+ txtProvider.Value.ToString().Trim() + "' and [Date] > "
+ txtBuyDate1.Value.ToString().Trim() + " and "
+ txtBuyDate1.Value.ToString().Trim() + " < "
+ txtBuyDate2.Value.ToString().Trim() + " group by Provider ";看看
<!--供应商配件供应额统计-->
<asp:DataGrid ID="Datagrid1" CssClass="Datagrid4" Runat="server" Visible="False" ShowHeader="False" GridLines="None" Height="30" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
供应商配件供应额统计 :
<%# DataBinder.Eval(Container.DataItem,"Money") %>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
+ txtProvider.Value.ToString().Trim() + "' or [Date] > "
+ txtBuyDate1.Value.ToString().Trim() + " and "
+ txtBuyDate1.Value.ToString().Trim() + " < "
+ txtBuyDate2.Value.ToString().Trim() + " group by Provider ";就行了~~~~
<HeaderTemplate>
供应商配件供应额统计
</HeaderTemplate>
<ItemTemplate>
<asp:Label id="label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Money") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateColumn>