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’
Related Posts:
- Selecting COUNT(*) with DISTINCT
- How can I do an UPDATE statement with JOIN in SQL Server?
- Column name or number of supplied values does not match table definition
- DateTime2 vs DateTime in SQL Server
- “select * into table” Will it work for inserting data into existing table
- What is a stored procedure?
- Self Join to get employee manager name
- How do I UPDATE from a SELECT in SQL Server?
- When should I use CROSS APPLY over INNER JOIN?
- INSERT statement conflicted with the FOREIGN KEY constraint – SQL Server
- INSERT statement conflicted with the FOREIGN KEY constraint – SQL Server
- How do I escape a single quote in SQL Server?
- T-SQL split string based on delimiter
- How do I escape a single quote in SQL Server?
- IDENTITY_INSERT is set to OFF – How to turn it ON?
- SQL Server FOR EACH Loop
- Best way to do nested case statement logic in SQL Server
- The multi-part identifier could not be bound
- Get day of week in SQL Server 2005/2008
- Sql Server string to date conversion
- How to parse XML data in SQL server table
- What is the equivalent of ‘describe table’ in SQL Server?
- How do I query for all dates greater than a certain date in SQL Server?
- Add a column with a default value to an existing table in SQL Server
- Error converting data type varchar to float
- I want to use CASE statement to update some records in sql server 2005
- What represents a double in sql server?
- Conversion failed when converting the varchar value ‘simple, ‘ to data type int
- SELECT DISTINCT on one column
- Exclude a column using SELECT * [except columnA] FROM tableA?
- Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 4 (Year)
- TSQL PIVOT MULTIPLE COLUMNS
- How to format a numeric column as phone number in SQL
- SQL “select where not in subquery” returns no results
- Equivalent of Oracle’s RowID in SQL Server
- Subtract one day from datetime
- Get current year in TSQL
- Is it possible to specify condition in Count()?
- SQL Server dynamic PIVOT query?
- How do I query for all dates greater than a certain date in SQL Server?
- Error converting data type varchar
- Temporary table in SQL server causing ‘ There is already an object named’ error
- I want to use CASE statement to update some records in sql server 2005
- How to calculate age (in years) based on Date of Birth and getDate()
- ORDER BY items must appear in the select list if SELECT DISTINCT is specified
- Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot
- How can I group by date time column without taking time into consideration
- SUM OVER PARTITION BY
- CASE IN statement with multiple values
- Update query using Subquery in Sql Server
- Varchar invalid for Sum operator
- Case in Select Statement
- Inserting multiple rows in a single SQL query? [duplicate]
- Must declare the scalar variable
- Must declare the scalar variable
- Rename column SQL Server 2008
- Drop a temporary table if it exists
- How do I perform an IF…THEN in an SQL SELECT?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- SQL Server : Arithmetic overflow error converting expression to data type int
- How to calculate percentage with a SQL statement
- Can a foreign key be NULL and/or duplicate?
- Why does NULL = NULL evaluate to false in SQL server
- Difference between JOIN and INNER JOIN
- Query error with ambiguous column name in SQL
- What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?
- Each GROUP BY expression must contain at least one column that is not an outer reference
- incorrect syntax error CREATE VIEW must be the only statement in the batch
- How to find sum of multiple columns in a table in SQL Server 2005?
- Check if table exists in SQL Server
- How can I truncate a datetime in SQL Server?
- Conversion of a varchar data type to a datetime data type resulted in an out-of-range value in SQL query
- How to group by month from Date field using sql
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- SQL – The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- How can I get column names from a table in SQL Server?
- Is there a combination of “LIKE” and “IN” in SQL?
- SQL Server reports ‘Invalid column name’, but the column is present and the query works through management studio
- SQL Server String or binary data would be truncated
- Remote table-Valued Function Calls are not allowed
- What is the Oracle equivalent of SQL Server’s IsNull() function?
- The backend version is not supported to design database diagrams or tables
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Sql query to insert datetime in SQL Server
- What is the difference between a stored procedure and a view?
- Why is SQL server throwing this error: Cannot insert the value NULL into column ‘id’?
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Bulk load data conversion error (truncation)
- ListAGG in SQLSERVER
- Is there a Max function in SQL Server that takes two values like Math.Max in .NET?
- sql query to return differences between two tables
- ‘CREATE PROCEDURE’ must be the only statement in the batch (Erro)
- SQL Server: Make all UPPER case to Proper Case/Title Case
- Backup a single table with its data from a database in sql server 2008
- Solutions for INSERT OR UPDATE on SQL Server
- Append table to an existing one: SQL Server
- SQL Server – An expression of non-boolean type specified in a context where a condition is expected, near ‘RETURN’
- Filter data based on date in sql
- How to dump a Microsoft SQL Server database to a SQL script?