Announcement:Materials and articles for ProductCart 5 can be found at our brand new support center.

Create an account to edit articles | See Formatting Syntax for Wiki syntax | We look forward to your contribution!

Date format issues on MS SQL servers with non-US local settings

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.

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.


QR Code
QR Code Date format issues on MS SQL servers with non-US local settings (generated for current page)