I have a datetime column that stores date example 20170313095154
when I try to query this I am getting an error
SELECT * from table where date=20170313095154
Arithmetic overflow error converting expression to data type datetime.
SELECT * from table where date='20170313095154'
Conversion failed when converting date and/or time from character string
Thanks Scott, the query worked but it is not retrieving records with the date if I use it in this format. The column is defined as [date] [datetime] NULL in the table and have values stored in format 20170313095154. Is there a function that I can use to translate it another datetime and get the correct records.
Thanks