Skip to content
  • There are no suggestions because the search field is empty.

How to Format the Date on MS SQL servers with Non-US Local Settings

Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.



The Issue

If you ever experience an error similar to the following: “Syntax error converting datetime from character string”, you should know that it typically indicates that your MS SQL server is not using the US settings (e.g. when the software was installed, different local settings were used).

ProductCart converts all dates to MM/DD/YY by default before they are saved into the database. This causes a problem as the server is instead expecting dates in the DD/MM/YY format.
 

The Solution

To fix this, download and open the file includes/SQLFormat.txt using Notepad. Change the line:
 
private const SQL_Format="0"

to

 
private const SQL_Format="1"

Save the file and upload it back to your Web server.

This tells ProductCart to convert the date to DD/MM/YY prior to inserting it into the database, and should fix the error that you were receiving.