Hi everyone
Can someone advise me what I can do to fix this problem please?
I have a query which calculates how many days between two date fields which works great. I use a module to do this and call the function in my query.
The database is for Taxi Scheduling. If a user selects a Friday (I have a Day combo box), it calculates how many Fridays are between 2 invoice dates. This works fine.
I am struggling with the second part of the query. I would like to count the number of Days between the 2 invoice fields but it has to take into account the EffectiveDate.
I have 3 fields:
EffectiveDate
InvoiceFrom
InvoiceTo
So If:
Day: Thursday
EffectiveDate = 25/09/08
InvoiceFrom = 23/09/08
InvoiceTo = 27/09/08
The answer should be 1 instance (of a Thursday between the two invoice dates)
Another example:
Day: Friday
Effective Date = 01/10/08
Invoice From = 01/11/08
InvoiceTo = 30/11/08
The answer should be 5 instances (of how many Fridays between the two invoice dates).
The problem I am having is that the query doesn’t even look at the EffectiveDate field and just counts how many days between the two invoice fields which gives me the wrong number of days as the EffectiveDate could be anywhere between the 2 invoice fields.
I hope I make sense.
Does anyone know how I can do this in a query please?
Many thanks in advance
Daz
Can someone advise me what I can do to fix this problem please?
I have a query which calculates how many days between two date fields which works great. I use a module to do this and call the function in my query.
The database is for Taxi Scheduling. If a user selects a Friday (I have a Day combo box), it calculates how many Fridays are between 2 invoice dates. This works fine.
I am struggling with the second part of the query. I would like to count the number of Days between the 2 invoice fields but it has to take into account the EffectiveDate.
I have 3 fields:
EffectiveDate
InvoiceFrom
InvoiceTo
So If:
Day: Thursday
EffectiveDate = 25/09/08
InvoiceFrom = 23/09/08
InvoiceTo = 27/09/08
The answer should be 1 instance (of a Thursday between the two invoice dates)
Another example:
Day: Friday
Effective Date = 01/10/08
Invoice From = 01/11/08
InvoiceTo = 30/11/08
The answer should be 5 instances (of how many Fridays between the two invoice dates).
The problem I am having is that the query doesn’t even look at the EffectiveDate field and just counts how many days between the two invoice fields which gives me the wrong number of days as the EffectiveDate could be anywhere between the 2 invoice fields.
I hope I make sense.
Does anyone know how I can do this in a query please?
Many thanks in advance
Daz