select b.MonthPayNo,b.EmployCode,a.EmployName,a.StationCode,d.StationName,c.DeptName,b.BasicPay,b.DutyAllow,b.Allowance,b.PerfPrix,b.Tax,b.AgainstPay,b.Annuity,b.Madicare,b.Loan,b.AbsencePay,b.PubDate,b.InDate,b.OprtrCode
from F_Employee_Tbl as a,P_MonthPay_Tbl as b,F_Dept_Tbl as c,F_Station_Tbl as d
where b.EmployCode=a.EmployCode and a.DeptCode=c.DeptCode and a.StationCode=d.StationCode
and datediff(day,PubDate,'2003-06-05')=0
from F_Employee_Tbl as a,P_MonthPay_Tbl as b,F_Dept_Tbl as c,F_Station_Tbl as d
where b.EmployCode=a.EmployCode and a.DeptCode=c.DeptCode and a.StationCode=d.StationCode
and datediff(day,PubDate,'2003-06-05')=0
解决方案 »
- 关于2005里面的ORDER BY
- 怎么去掉SQLServer中默认输出的临时变量的结果?(具体如下)
- 请教关于SQL2000检查点的问题
- 不能授予或废除特权~~~~
- SQL 2005 查询问题(急)
- 为什么下面的代码不能检索出数据来?
- 银行储蓄存款数据,查询排序的实现??100分请教,在线等.
- 这个SQL,怎么写?能写出来吗?
- 有个SQL小问题,希望大家帮忙!
- 您们说,我什么证书也没有,(当然有个学位证 :))考mcdba好吗?因为我考不了mcsd.我喜欢编程可老学不好。
- 我刚学编程没有多久,发现在数据库很重要,但不知道怎样一个用一个系统方法去学习?请各们前辈能给我以指点。非常感谢!!!
- 储存过程中的一批命令是不是同一个transcation?
from F_Employee_Tbl as a,P_MonthPay_Tbl as b,F_Dept_Tbl as c,F_Station_Tbl as d
where b.EmployCode=a.EmployCode and a.DeptCode=c.DeptCode and a.StationCode=d.StationCode
and year(PubDate)=2003
and month(PubDate)=6
and day(PubDate)=5
判断为同一天!
函数判断PubDate和'2003-06-05'相差0天,也就是同一天
DATEDIFF
返回跨两个指定日期的日期和时间边界数。 语法
DATEDIFF ( datepart , startdate , enddate )