Answer the question
In order to leave comments, you need to log in
MS SQL select by datetime?
I can't understand the logic. I'm tinkering with someone else's code. there skl request of the form
select * from
db
where DATE_IZMER>='01.11.2015'
and DATE_IZMER<='30.11.2015'
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
Answer the question
In order to leave comments, you need to log in
Write in the format Ymd: 20151112, this is a locale-independent format, it will always work.
If you just need to see the result of the query - try writing the dates in the format 'yyyy-MM-dd'
This should work.
Writing in the manager at the beginning of the session, I don’t know why, it resets after a restart for me.
If the query is written to quickly look, it is more visual to use the format '12 december 2015', '1 november 2015', etc. To cast to a date, it is better to write CONVERT instead of CAST with an explicit indication of the date style.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question