返回处理后的数据,不同于round()(对数值进行四舍五入处理),该函数不对指定小数前或后的数值部分进行舍入处理. 语法:trunc(number[,decimals]) 其中,number为待做处理的数值,decimals为需要保留小数点后面的位数,即精度,默认值为0,此时将截去所有的小数部分. 数值处理: select trunc(123.45) as a,trunc(123.456,2) as b, trunc(123.45,-1) as c from dual ;
一:DateTime.IsLeapYear 方法判断是否是闰年 二:代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace GetDays { public pa
用sql查询当天,一周,一个月的数据 数据查询,不管在网站还是在系统,都很常见,下文是介绍最常见的以日期查询的语句 select * from ShopOrder where datediff(week,ordTime,getdate()-1)=0 //查询当天日期在一周年的数据 select * from ShopOrder where datediff(day,ordTime,getdate()-1)=0 //查询当天的所有数据 --查询当天: select * fro
转自:http://www.cnblogs.com/likwo/archive/2010/04/16/1713282.html 查询一天: select * from table where to_days(column_time) = to_days(now());select * from table where date(column_time) = curdate(); 查询一周: select * from table where DATE_SUB(CURDATE(), INTER
(转载)http://www.cnblogs.com/likwo/archive/2010/04/16/1713282.html 查询一天: select * from table where to_days(column_time) = to_days(now());select * from table where date(column_time) = curdate(); 查询一周: select * from table where DATE_SUB(CURDATE(), INTE
问题 今天在之前的代码中发现了一个bug,有个计算当前时间减少一个月的函数,其报出下面的异常信息: ValueError: day is out of range for month 看一下代码: import datatime def _last_month(now_time): last_month = now_time.month - 1 last_year = now_time.year if last_month == 0: last_month = 12 last_year -= 1