I have a table as follow, AAA and BBB are number type. I want to calculate the difference between the values in the AAA and BBB columns, with the unit in days,and write the number of days into the CCC column.
What should I do? Thank you
I have a table as follow, AAA and BBB are number type. I want to calculate the difference between the values in the AAA and BBB columns, with the unit in days,and write the number of days into the CCC column.
What should I do? Thank you
First convert the number to a string, which you then use to create a DateTime representation of the date. These can be subtracted from each other and converted to days (datetime is the number of seconds since 01.01.1601, so to convert to days, divide by 86400).
To successfully convert to the datetime class, you have to add a delimiter between the year, month and day. Otherwise the program will interpret the first 1 of 11 to mean "January" and assume the rest is the day, leading to an error.
If you import the dates in another format the conversion might become easier.
11 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved