Skip to main content
The answer was unclear and misleading with regards to the second date
Source Link

you should put those two dates between single quotes like..

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date >= '2011/02/25' and Date <= '2011/02/27'

keep in mind that the first date is inclusive, but the second is exclusive, as it effectively is '2011/02/27 00:00:00'

you should put those two dates between single quotes like..

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date >= '2011/02/25' and Date <= '2011/02/27'

you should put those two dates between single quotes like..

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date >= '2011/02/25' and Date <= '2011/02/27'

keep in mind that the first date is inclusive, but the second is exclusive, as it effectively is '2011/02/27 00:00:00'

Changed the ">" and "<" to ">=" and "<=" to make it inclusive like the "between" operator in the example above it. Also added spaces for readability.
Source Link

you should put those two dates between single quotes like..

select Date, TotalAllowance from Calculation where EmployeeId=1EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId=1EmployeeId = 1
             and Date>'2011Date >= '2011/02/25' and Date<'2011Date <= '2011/02/27'

you should put those two dates between single quotes like..

select Date,TotalAllowance from Calculation where EmployeeId=1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date,TotalAllowance from Calculation where EmployeeId=1
             and Date>'2011/02/25' and Date<'2011/02/27'

you should put those two dates between single quotes like..

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date >= '2011/02/25' and Date <= '2011/02/27'

you should put those two dates between single quotes like..

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 between '2011/02/25' and '2011/02/27'

or can use

select Date,TotalAllowance from Calculation where EmployeeId=1 and Date>'2011/02/25' and Date<'2011/02/27'

select Date,TotalAllowance from Calculation where EmployeeId=1
             and Date>'2011/02/25' and Date<'2011/02/27'

you should put those two dates between single quotes like..

select Date,TotalAllowance from Calculation where EmployeeId=1 and Date between '2011/02/25' and '2011/02/27'

or can use

select Date,TotalAllowance from Calculation where EmployeeId=1 and Date>'2011/02/25' and Date<'2011/02/27'

you should put those two dates between single quotes like..

select Date,TotalAllowance from Calculation where EmployeeId=1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date,TotalAllowance from Calculation where EmployeeId=1
             and Date>'2011/02/25' and Date<'2011/02/27'
Source Link
Deepak
  • 8k
  • 3
  • 26
  • 26
Loading