An interesting Dynamics GP query question came up on Experts Exchange. The user was asking how to select transactions for a given date range from the PM30300 table. Pretty straightforward--I recommended this query as a start:
SELECT * FROM TWO..PM30300 WHERE DOCDATE BETWEEN '2017-01-01' AND '2017-03-31'
The user tried it, but said that he received the following error:
Msg 242, Level 16, State 3, Line 1
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
9/10/2015 UPDATE: David Musgrave offered some sage wisdom in the comments. He explained that if you use the date format of YYYYMMDD in SQL queries, you avoid these issues. Sure enough, this query works regardless of the Default Language setting.
SELECT * FROM TWO..PM30300 WHERE DOCDATE BETWEEN '20170115' AND '20170331'