常用查询条件

来源:互联网 发布:mac如何设置用户名 编辑:程序博客网 时间:2024/05/01 17:13

时间

DateTime MyDate;
        if (DateTime.TryParse(txtStartDate.Text.Trim(), out MyDate) == true)
        {
            int year = Convert.ToInt32(MyDate.Year);
            int month = Convert.ToInt32(MyDate.Month);
           strWhere +="and year([Date])= " + year + " and month([Date])=" + month + "";

        }

 strWhere +=" and year([Date])= " + year + " and month([Date])=" + month + "";

 

转换字段 数据类型

convert(int," + filed + ")

select sum(convert(int," + filed + ")+convert(int," + filed1 + ")) from AccuracyModifyInfo

0 0
原创粉丝点击