0

Enter date directly into a formula

Is there a way to add a date directly into a formula. Have a Monthly Table and want to show the number of days since  22/10/2008 (DD/MM/YYYY) for each month. 

Have attempted days(22/10/2008, Date2) formula but that shows incorrect answer for end of June = 18,443 whereas should be 4270. Presume isn’t accepting as a date?

Any assistance would be appreciated

Alan

2 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view

    The days() function expects either a date value or a numeric representation of the date. Here's one way to do what you want...

     

    days(date(2008, 10, 22), date(2020, 6, 30))

     

    The date() function takes the date arguments in year/month/day order. The result returned is 4269 which is the same result in OpenOffice Calc.

    • alanaveyard
    • 4 yrs ago
    • Reported - view

    Hi Sean, thats just what I require. Have used the date function for the first date and the field for the second

    days(date(2008, 10, 22), 'To') many thanks