New Bug Encountered: Duration format changes on save

My app has a duration field called โ€œFirstBreakDurationโ€ with appsheet data type DURATION for when someone takes a break we can record the duration taken.

When the user enters into the form the duration as 00:30 and then saves, the value is changed to 0 00:30:00.000000. Once this happens any equations that I have using the TOTALHOURS() function do not work after the save.

I am using mysql as the app data source and the field is set to VARCHAR(20) for the mysql datatype. Has anyone experience this before?

Solved Solved
0 11 359
1 ACCEPTED SOLUTION

You are using completely a wrong SQL data time for your purpose. VARCHAR is for text type and you should be using TIME data type instead.


With VARCHAR(20) all you will be seeing is absolutely this:

I may also advise checking this post from StackOverflow:

View solution in original post

11 REPLIES 11

Not sure about that, but I have a suggestion of a different way to build this part of your app. Give a Number type input field for โ€œDuration of first break (in minutes)โ€. Then use an expression to convert that into the Duration in another column. This makes it an easier value for a user to input, and then gives you validation control so that the duration value is generated correctly.

Hi @Marc_Dillon, updated the solution as @LeventK has shown that MySQL can use TIME as the right data type for DURATION in AppSheet. Formatting comes through correctly now. Thanks for your solution though.

I will check that now. Thanks @Marc_Dillon

Hi @Marc_Dillon, your solution was a good work around. Thanks for your help. Still doesnโ€™t answer why the value keeps getting changed thoughโ€ฆ

Does it happen when it is entered as โ€œ000:30:00โ€ ?

Probably should have asked that firstโ€ฆ

Yes it does. I think it might be the way that Mysql was storing the information.

I encourage you to engage support@appsheet.com on this. It might be a bug.

Have submitted to Support for a check. Thanks.

You are using completely a wrong SQL data time for your purpose. VARCHAR is for text type and you should be using TIME data type instead.


With VARCHAR(20) all you will be seeing is absolutely this:

I may also advise checking this post from StackOverflow:

Just updated the field to time in MySQL and duration in AppSheet. This worked. Thanks @LeventK.

Youโ€™re welcome @David_Hoffman, my pleasure to be helped of.

Top Labels in this Space