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! Go to 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.
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.
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.
User | Count |
---|---|
42 | |
25 | |
25 | |
17 | |
12 |