 # Calculate number of days between two dates

#1

I’ve ever only used the simplest operators to do arithmetic calculations that fill a field. It appears I would use datevalue( to plug in the number of days between DateA and DateB fields, but how to write the formula?

#2

If you have two date fields, you can calculate the number of days between with simple subtraction, for example

``````DateB-DateA
``````

That’s it!

The datevalue( function is only used if you have separate values for year, month and day and you want to convert them into a Panorama date value, which combines all three into a single value.

A more commonly used function is date(, which converts text like `2/17/2018` or `Jan 5` into a date value.

But if you are using a date field type, you usually don’t need either of these functions.

You may find this general help page about date calculations and conversions helpful.

#3

Thank you! Leave it to me to complicate yet another thing you’ve made easy in X!

-Peeter

#4

Date arithmetic actually works exactly the same in Panorama X as it did in previous versions.