-
1
- #1
spartansFC
Programmer
Hi
I have a table which shows a dteYear based off dteSessionDates but it's showing the wrong year, all i'm doing at the moment to get the year is:
The above isn't correct and giving off some wrong dates
03/10/2023 = 2023 (which is correct)
10/01/2023 = 2023 (which is wrong, should be 2022)
An actual year is between 1 April to 31 March of the next year.
I could put a nested If statement in the query but you're only allowed so many of them, i did see a while ago where there was a table created, with the from and to dates and the year.
DateFrom Dateto Year
01/04/2020 31/03/2021 2020
01/04/2021 31/03/2022 2021
01/04/2022 31/03/2023 2022
01/04/2023 31/03/2024 2023
You add this table to the query and do a Where statement, it must be something like
Select Year from tblDateFromTo Where dteSessions is between Datefrom and Dateto
Anyone help me out
Mikie
I have a table which shows a dteYear based off dteSessionDates but it's showing the wrong year, all i'm doing at the moment to get the year is:
Code:
dteYear: Format([dteSessionDates],"yyyy")
The above isn't correct and giving off some wrong dates
03/10/2023 = 2023 (which is correct)
10/01/2023 = 2023 (which is wrong, should be 2022)
An actual year is between 1 April to 31 March of the next year.
I could put a nested If statement in the query but you're only allowed so many of them, i did see a while ago where there was a table created, with the from and to dates and the year.
DateFrom Dateto Year
01/04/2020 31/03/2021 2020
01/04/2021 31/03/2022 2021
01/04/2022 31/03/2023 2022
01/04/2023 31/03/2024 2023
You add this table to the query and do a Where statement, it must be something like
Select Year from tblDateFromTo Where dteSessions is between Datefrom and Dateto
Anyone help me out
Mikie