MMMHUHU
2019-07-08 16:32:11
SQL查詢?cè)趦蓚€(gè)日期之間選擇日期我有一個(gè)start_date和end_date..我想得到這兩個(gè)日期之間的日期列表。有人能幫我指出我查詢中的錯(cuò)誤嗎。select Date,TotalAllowance
from Calculation
where EmployeeId=1
and Date between 2011/02/25 and 2011/02/27這里Date是datetime變量。
3 回答

滄海一幻覺(jué)
TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超5個(gè)贊
select Date, TotalAllowance from Calculation where EmployeeId = 1 and Date between '2011/02/25' and '2011/02/27'
select Date, TotalAllowance from Calculation where EmployeeId = 1 and Date >= '2011/02/25' and Date <= '2011/02/27'

交互式愛(ài)情
TA貢獻(xiàn)1712條經(jīng)驗(yàn) 獲得超3個(gè)贊
date 00:00:00.000
<
.
select Date,TotalAllowance from Calculation where EmployeeId=1 and Date between '2011/02/25' and '2011/02/27 23:59:59.999'
select Date,TotalAllowance from Calculation where EmployeeId=1 and Date >= '2011/02/25' and Date < '2011/02/28'
select Date,TotalAllowance from Calculation where EmployeeId=1 and Date >= '2011/02/25' and Date <= '2011/02/27 23:59:59.999'
select Date,TotalAllowance from Calculation where EmployeeId=1 and Date between '2011/02/25' and '2011/02/28'

湖上湖
TA貢獻(xiàn)2003條經(jīng)驗(yàn) 獲得超2個(gè)贊
select Date,TotalAllowance from Calculation where EmployeeId=1 and [Date] between '2011/02/25' and '2011/02/27'
Date
添加回答
舉報(bào)
0/150
提交
取消