Date Calculation

I have a form that I like to be bale to know how many day shave been from the that the claim done.

so I have a filed that has a date 12/12/2011 I want to have a filed next to it that gives me the amount of days that have gone by between that date and the current date.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


you need to give some more detailes, like what software, what kind of form.
anyhoo if you are using exel just Subtract you date from the other date and it will give you the days number.

North2AlaskaSenior EngineerCommented:
It is a very simple calculation:

Get ( CurrentDate ) - YOUR_DATE_FIELD

If you want the time too:

Get ( CurrentTimeStamp ) - YOUR_TIMESTAMP_FIELD
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

noadAuthor Commented:

So the cal I should do it on the age filed, correct?
North2AlaskaSenior EngineerCommented:
Yes, it could be a calculated field.  
noadAuthor Commented:

I may have explained it wrong...

I have a filed named datecreated ( record cleaning filed ) and I have a filed named date of loss.

I want to know how many days have gone by from the time the loos happended till the day it is being reported.
see error when I input your suggestion
North2AlaskaSenior EngineerCommented:
Get ( CurrentDate ) and Get ( CurrentTimeStamp ) are Get functions and should be used exactly.  Get ( CurrentDate ) returns todays date.  So to find the number of dates between the dateofinsuranceloss and today you would use

Get ( CurrentDate ) - dateofinsuranceloss

To also continue the discussion, I suspect you will have different dates; One for the Date Reported and one for the Date of Loss.  With this in mind you may want to explore using the Get function only when the Date Reported is not filled in.  Something like:

If ( IsEmpty ( Date Reported ) ; Get ( CurrentDate ) ; Date Reported ) - Date of Loss

Something like that, anyway...
noadAuthor Commented:

Not sure I follow, I want to know how many days have  passed from the time of the loss to the current date.
I'll try your above cal. Will let you know on the road right now.  
Thanks for all of your help.  
North2AlaskaSenior EngineerCommented:
From your previous description I think you will have three Dates;  "Date of Loss", "Date Reported" and you mentioned "Date Created". I think you will need a fourth; "Date Closed".

The function "Get ( CurrentDate )" is a FileMaker function that returns...  You guessed it...  the current date, Today.

So to calculate the number of days between any two dates, subtract one from the other.  

(Quotes are added for better definition. Don't use the quotes.)
"Date Reported" - "Date of Loss" is the number of days between the two events.
"Get ( CurrentDate )" - "Date of Loss" then is the number of days between these two events.

The new date I recommended is "Date Closed" (use whatever terminology for your industry) is when you want to quit using the "Get ( CurrentDate )" and indicate that no more days are important.  The item is finished, closed, ended...  So how do we do both, use the "Get ( CurrentDate )" and "Date Closed" to calculated the number of days between the events.  This is where you would use the formula I posted previously.

If ( IsEmpty ( "Date Closed" ) ; "Get ( CurrentDate )" ; "Date Closed ) - "Date of Loss"

This formula says if we don't have a "Date Close" use the current date, otherwise use the "Dated Closed".  And from the result subtract the "Date of Loss".  

Maybe its more than you wanted to know, but I had fun with it...  :-)  Good luck.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
noadAuthor Commented:

That worked great!
Thank you very much.
noadAuthor Commented:
North knows,,,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.