Default date format incompatible with my MS SQL Date Format


#1

Hi

I am running dm v2803, which is connected to a remote MS SQL server.
The problem I have is that when I try to retrieve data from a table using date as a filter, I get a out of range error.

After looking at the response, it immediately became obvious to me what the error was: The api automatically formats my input, ‘14-08-2017’, into Y-m-d H:i:s format, which is rejected by my sql server as it is setup to function with the d-m-Y format.
No matter how I format my input, the api always formats it into it’s own default date format.

I tried changing the timezone in my php.ini and env files to Europe/London, hoping the api would format it to my country’s standard, but it did not do anything.

Is there anyway i can force the api to either not format my input or allow me to choose the date format?

As a temporary solution I am currentelyretrieving the data using a sql procedure, so that the api is forced to treat it as I want.

Request URL

http://127.0.0.1/api/v2/myapi/_table/InvoiceTables?fields=InvId%2C%20InvoiceDate&filter=InvoiceDate%20>%2014-08-2017

Response Body

{
“error”: {
“code”: 500,
“context”: null,
“message”: “Failed to retrieve records from ‘InvoiceTables’.\nSQLSTATE[22007]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value. (SQL: select count(1) as aggregate from [dbo].[InvoiceTables] where [InvoiceDate] > 2017-08-14 00:00:00)”,
“status_code”: 500
}
}