Hello,
I have a crosstab query that selects and counts all contracts that are due within 3 months of Febuary, March and April. I'm trying to pull counts together and I'm using Select Case for the criteria as below:
If a date is 15/04/10(dd/mm/yyy) for example I would like for that to show up in all 3 counts.
The thing is that it seems to only count febuarys data in full and incorrect values come up for the other 2 months. I assume it because VBA will priotise the count on the first line of the select case?
Is there anyway round this?
tia
I have a crosstab query that selects and counts all contracts that are due within 3 months of Febuary, March and April. I'm trying to pull counts together and I'm using Select Case for the criteria as below:
Code:
Public Function Months(DiscDate As Date) As String
Select Case DiscDate
Case #1/2/2010# To #4/30/2010#: Months = "Feb"
Case #1/3/2010# To #5/31/2010#: Months = "Mar"
Case #1/4/2010# To #6/30/2010#: Months = "Apr"
Case Is < #1/2/2010#: Months = "Out of Contract"
Case Else
Debug.Print DiscDate
End Select
End Function
If a date is 15/04/10(dd/mm/yyy) for example I would like for that to show up in all 3 counts.
The thing is that it seems to only count febuarys data in full and incorrect values come up for the other 2 months. I assume it because VBA will priotise the count on the first line of the select case?
Is there anyway round this?
tia