Hi,
I submitted this message yesterday and had a couple of replies, but none have been any use, so here goes again!
I have a form which allows a user to select two financial years - one is the beginning financial year and the other is the end which feeds into a query which outputs all records between the two financial years.
Because Access has no data type for storing financial years, I have to store them as strings (eg "97/98". This obviously means I cannot use the "Between" function in the query to bring up all the intervening years (eg Between "97/98" And "01/02".
To try and get around this I have a function called "getfinyears" that returns to the criteria box in the query the correct expression (in the example above the expression returned should be:
"97/98" Or "98/99" Or "99/00" Or "00/01" Or "01/02"
which would return the required records.
Unfortunately because the "getfinyears" function returns a string, the actual expression returned is:
"97/98 Or 98/99 Or 99/00 Or 00/01 Or 01/02"
meaning that Access looks for the entire string, rather than each separate string separated by Or clauses.
Can anyone help?
I submitted this message yesterday and had a couple of replies, but none have been any use, so here goes again!
I have a form which allows a user to select two financial years - one is the beginning financial year and the other is the end which feeds into a query which outputs all records between the two financial years.
Because Access has no data type for storing financial years, I have to store them as strings (eg "97/98". This obviously means I cannot use the "Between" function in the query to bring up all the intervening years (eg Between "97/98" And "01/02".
To try and get around this I have a function called "getfinyears" that returns to the criteria box in the query the correct expression (in the example above the expression returned should be:
"97/98" Or "98/99" Or "99/00" Or "00/01" Or "01/02"
which would return the required records.
Unfortunately because the "getfinyears" function returns a string, the actual expression returned is:
"97/98 Or 98/99 Or 99/00 Or 00/01 Or 01/02"
meaning that Access looks for the entire string, rather than each separate string separated by Or clauses.
Can anyone help?