Filter by period then filter by term if not already submitted

Hi all

I’m stuck trying to work out a table / formula that will determine if a date falls within a period.

Basically I’m using Coda to track my receipts and invoices, so far it’s working fine but I am now wanting to filter out certain information.

In the UK, If you are VAT registered you need to submit a VAT return every quarter of the year. You are assigned this but it is either one of of the following three choices:

Jan, Apr, Jul, Oct,
Feb, May, Aug, Nov
or
Mar, Jun, Sep, Dec

Let’s say i’ve been assigned: Jan, Apr, Jul, Oct.
At the end of Jan, Apr, Jul or Oct I would need to submit a VAT return for the previous 3 months.

i.e For January’s VAT return, I would need to submit the data for the receipts or invoices dated between 1st November 2018 - 31st January 2019 (3 Months) When it comes to April, I would need to submit returns between 1st February - 30th April.

This happens 4 times a year. January (being the first return), April (being the second return), July (being the third return), October (being the forth return)

Any ideas how I can filter the information based on this?

I have created a documents with the following
• Period selection
• Invoices

  • Receipts
    • VAT Submission

Want I can’t do is figure out is, If Januarys report hasn’t been submitted, how do I grab the data from the receipts and invoices tables for the 3 months I need?

Sorry if i’ve not explained it correctly I’m still trying to get my head around it.