April 10, 2013 at 2:01 pm
Hello,
I am trying to perform a select based on a condition that the "datetime" formatted column is today's date
2012-12-17 13:57:38.057
what would be the syntax?
thank you
April 10, 2013 at 2:03 pm
johnnyrmtl (4/10/2013)
Hello,I am trying to perform a select based on a condition that the "datetime" formatted column is today's date
2012-12-17 13:57:38.057
what would be the syntax?
thank you
Do you care about the time (thinking not)?
WHERE cast(datecolumn as DATE) = cast(getdate() as DATE) -- From what I have read this is actually SARGable due to the data types involved
April 10, 2013 at 2:03 pm
johnnyrmtl (4/10/2013)
Hello,I am trying to perform a select based on a condition that the "datetime" formatted column is today's date
2012-12-17 13:57:38.057
what would be the syntax?
thank you
Not totally sure what the question is here. Is the column a datetime column? Need a little bit more detail here to offer much assistance.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 10, 2013 at 2:07 pm
yep the column is in a "datetime" format
The question is that I have to perform a select on a column ( in a datetime format ) with a condition of today's date
April 10, 2013 at 2:10 pm
johnnyrmtl (4/10/2013)
yep the column is in a "datetime" format
You are saying that the datatype of the column is datetime, correct?
April 10, 2013 at 2:12 pm
correct
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply