Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculating year from range

Featured Replies

Hi guys,

I have a database of invoices. What i'm stuck on is I need to create a total of just those invoices that fall in any given financial year.

Australian financial year runs from 01/07/year to 31/06/year (e.g 1 July 2004 to 31 June 2005).

I think my problem is text -v- date but can't seem to work it out.

I have a global field being the entry of the current financial year. so if( CurrentFinancialYear = Invoice Year; Fees; "")

But I can't even get InvoiceYear to be calc'd???

The calc of the InvoiceYear is:


Case(

InvoiceDate  ≥  "1/7/2004"  and InvoiceDate   ≤  "31/6/2005"; "2004"; 

InvoiceDate  ≥  "1/7/2005"  and InvoiceDate   ≤  "31/6/2006"; "2005"; 

InvoiceDate  ≥  "1/7/2006"  and InvoiceDate   ≤  "31/6/2007"; "2006"; 

InvoiceDate  ≥  "1/7/2007" and InvoiceDate   ≤  "31/6/2008"; "2007"; "2008")

Thanks in advance

Hows about:

Year ( Date ( Month ( InvoiceDate )+6 ; Day ( InvoiceDate ) ; Year ( InvoiceDate ) ) )

--sd

or:

Year ( InvoiceDate ) + ( Month ( InvoiceDate ) > 6 )

Note that "31/6/2005" is not a valid date - June has only 30 days.

Year ( InvoiceDate ) - ( Month ( InvoiceDate ) < 7 )

I think.

  • Author

so simple, so brilliant.. thanks guys you rock!!!

Year ( InvoiceDate ) - ( Month ( InvoiceDate ) < 7 ) was the winner to get the correct year :P

Note that "31/6/2005" is not a valid date - June has only 30 days.

doh.. slip of fingers :

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.