Search Results

Search found 1 results on 1 pages for 'tomsullivan1989'.

Page 1/1 | 1 

  • SQL datetime LIKE select - why do I need an extra %?

    - by tomsullivan1989
    Can someone explain to me why when I perform a LIKE select in SQL (T-SQL) on a varchar column I can do the following: SELECT * FROM Table WHERE Name LIKE 'Th%' to get names beginning with Th, but when I do the same on a datetime column I need a % before the year, like: SELECT * FROM Table WHERE Date LIKE '%2013%' to get dates in 2013. The datetimes are stored in yyyy-MM-dd hh:mm:ss format. I know I could use a DATEPART style query but I was just interested in why I need the extra % here.

    Read the article

1