Esempio n. 1
0
        /// <summary>
        /// 处在选择的时间范围内的天数
        /// </summary>
        /// <param name="time1">时间1</param>
        /// <param name="time2">时间2</param>
        /// <param name="corpName">具体表</param>
        /// <returns></returns>
        public static int get_DateCount(DateTime time1, DateTime time2, string corpName)
        {
            string str_datecount = "select count(distinct MONITORTIME) from " + corpName + " where MONITORTIME between @time1 and @time2";

            SqlParameter[] param_date = new SqlParameter[] {
                new SqlParameter("@time1", time1),
                new SqlParameter("@time2", time2)
            };

            int count = DataBaseOperate.getIncludeTimeCount(str_datecount, param_date);

            return(count);
        }