Use the CAST
to the new DATE
data type in SQL Server 2008 to compare just the date portion:
IF CAST(DateField1 AS DATE) = CAST(DateField2 AS DATE)
More Related Contents:
- I dont know sql syntax for my table [closed]
- Is it possible to write single query on two table which are not connected to each other?
- T-SQL split string
- Can I Comma Delimit Multiple Rows Into One Column? [duplicate]
- How can I get column names from a table in SQL Server?
- Conditional WHERE clause in SQL Server
- How can I select the first day of a month in SQL?
- Split function equivalent in T-SQL?
- Is the NOLOCK (Sql Server hint) bad practice?
- Multi-statement Table Valued Function vs Inline Table Valued Function
- Select statement to find duplicates on certain fields
- Is having an ‘OR’ in an INNER JOIN condition a bad idea?
- Where value in column containing comma delimited values
- Parse comma-separated string to make IN List of strings in the Where clause
- SQL query to split column data into rows
- T-SQL split string based on delimiter
- Bulk DELETE on SQL Server 2008 (Is there anything like Bulk Copy (bcp) for delete data?)
- Split function in SQL Server 2008
- Cannot use a CONTAINS or FREETEXT predicate on table or indexed view because it is not full-text indexed
- SQL “between” not inclusive
- Can I set ignore_dup_key on for a primary key?
- Using PIVOT in SQL Server 2008
- How do I prevent a database trigger from recursing?
- How can I group by date time column without taking time into consideration
- How to combine results of two queries into a single dataset
- When using GETDATE() in many places, is it better to use a variable?
- Executing SQL Server Agent Job from a stored procedure and returning job result
- Cumulative Total in MS Sql server [duplicate]
- SQL Server SELECT INTO @variable?
- SQL Server: +(unary) operator on non-numeric Strings