I have list of product batches that have a Batch Creation and Batch Expiry Date as a Date column types.
I have created two virtual columns respectively:
I thought I could use the following expressions based on what I saw in other posts:
I tried using both Number and Decimal column type for the virtual columns but I recieved the following error respectively
The expression is valid but its result type โDurationโ is not one of the expected types: Decimal
I get the same for Number column type.
What am I missing here?
Solved! Go to Solution.
The result for this [Batch Expiry] - [Batch Creation] is a duration like hours:minutes:seconds. If you want to have it as days, you should write it like TOTALHOURS([Batch Expiry] - [Batch Creation])/24
The result for this [Batch Expiry] - [Batch Creation] is a duration like hours:minutes:seconds. If you want to have it as days, you should write it like TOTALHOURS([Batch Expiry] - [Batch Creation])/24
Perfect thanks that works
How complex would it be to design a expression that converted the duration between two dates as would a similar Datedif function in excel
See below excel fuction for caluculation of expression
This is the expression in excel:
=DATEDIF(G6,H6,โyโ)&" years, "
&DATEDIF(G6,H6,โymโ)&" months, "
&H6-DATE(YEAR(H6),MONTH(H6),1)&" days"
Here is an overview of how the dateif formula works if you not familiar with it.
They even have a downloadable excel document.
Are you able to replicate this expression in appsheet.
Hello Michael, If you still waiting for the answer. Try this one:
Go to the setting of your column duration > Auto Compute > Spreadsheet Formula.
You can use this Formula :
IF(INDIRECT(โHโ&ROW())="";"";DATEDIF(INDIRECT(โHโ&ROW());TODAY();โYโ)&" Years, โ&DATEDIF(INDIRECT(โHโ&ROW());TODAY();โYMโ)&โ Month, โ&DATEDIF(INDIRECT(โHโ&ROW());TODAY();โMDโ)&โ Days")
Let me explain some part of the formula to you
Hope this will help you
Thanks
User | Count |
---|---|
40 | |
34 | |
29 | |
23 | |
17 |