你用的什么数据库?
oracle的两个date类型是可以直接比较的。
如:select * from tabname where datefield>to_date('2002-02-02','YYYY-MM-DD')mysql的话:
select * from tabname where to_days(datefield)>to_days('2002-02-02')
oracle的两个date类型是可以直接比较的。
如:select * from tabname where datefield>to_date('2002-02-02','YYYY-MM-DD')mysql的话:
select * from tabname where to_days(datefield)>to_days('2002-02-02')
我用sqlserver2000
String的 a.equals(b);不行啊
我的语句是这样的:
if()//判断bill_date和bill_date_hidden日期是否相等?
{
String sql_biller_date = "update e_cgdd1 set biller_date = '"+biller_date+"' where caigou_no = '"+caigou_no+"'";
if语句怎么写啊?怎么判断日期一样啊?
比如:2002-2-2和2002-2-3
Date b;
a.compareTo(b);
相等返回0;
大于反回1;
小于返回-1;
a.after(b)
返回true,false
a.before(b);
返回true,false;