Left和date_format函数:
[code]
$sql="select count(*) from Tbl_XXshow_XX where FXX='$XX' and FCode=2 and left(FTime,7)=left(now(),7)";
select count(*) as c from Tbl_Exchange_XX where FLType=218 and date_format(now(),'%Y-%m-%d')=date_format(FTime,'%Y-%m-%d')
[/code]
[code]
$sql="select count(*) from Tbl_XXshow_XX where FXX='$XX' and FCode=2 and left(FTime,7)=left(now(),7)";
select count(*) as c from Tbl_Exchange_XX where FLType=218 and date_format(now(),'%Y-%m-%d')=date_format(FTime,'%Y-%m-%d')
[/code]
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/2423/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表