Why can't I update my database?

I am using Azure Sql Database and have this table

CREATE TABLE [dbo].[test]
(
	[Id] INT NOT NULL PRIMARY KEY, 
    [Description] VARCHAR(50) NULL, 
    [ANumber] SMALLINT NOT NULL, 
    [ADate] DATE NOT NULL
)
GO
INSERT INTO [dbo].[test]
           ([Id]
           ,[Description]
           ,[ANumber]
           ,[ADate])
     VALUES
           (1,'This is the desc',4,'2023-04-20')
GO

I created a new App from this table

The App doesn't load any rows by default but I fix that in the Query from

to

The App then loads the data fine.

In the table I changed the datatype of the Date from Auto to Date (d MMM, yyyy). I also change the format of the Date in the form to (yyyy-MM-dd) so Azure SQL understands it correctly.

If I change the value in form of the field "A date", to 2023-04-21 and click Save Changes the databases is not updated. Here's the Console:

What am I doing wrong? Why isn't the data saving?

EDIT

Also ,if I try and add a new row, Retool sends a datetime value from the date control which causes it to fail:

addRow failed (0.555s):insert into [dbo].[test] ([ADate], [ANumber], [Description], [Id]) output inserted.* values (@p0, @p1, @p2, @p3) - Conversion failed when converting date and/or time from character string.

addRow![](https://retool-edge.com/2382871a28f6929095e6fbae64fb92c5.svg)

from addRow response(addRow)

▶in addRow.trigger()(updateDataForm)

1. ▶changeset: {Id: "2", Description: "Another description", ANumber: "42", ADate: "2023-08-14T14:17:18.431+0100"}

  1. Id: "2"

  2. Description: "Another description"

  3. ANumber: "42"

  4. ADate: "2023-08-14T14:17:18.431+0100"

triggeredById: "updateDataForm"environment: "production"

in updateDataForm submit event handler(updateDataForm)

from user interaction

I just created a PostGres database in Azure as a test and it works just fine. Is Retool compatible with Azure SQL Database?

As a workaround I am using .formattedValue instead of .value. Seems to work ok.

Hey @totaltool! Thanks for posting so much detail about your process here. Retool should be compatible with both Postgres and Azure SQL but the slight differences in SQL syntax of different databases can be tricky to keep track of. It's super helpful when people post specific cases like these that can be referenced in conjunction with the SQL cheatsheet.