N
NoCanDo
Hi
I'm new to Access Monster, but not access. Using Access 2003 and would like
to use the 1st April as the start date for any particular reporting year so
that I can pull out historic data from a much larger dataset.
My very simple query selects a single field record (Date format) from a table
and I want to use that as the basis of another query on another table where
it is used as the Between 'date' And Date().
To simplify matters I created a very two simple tables called:
Temp - Year which contins one field YearStartDate (Date/Time data type)
DateTest which contains two fields: EraDate (Date/Time data type) and
TestNumber (Number data type)
I want to use the [Temp - Year].[YearStartDate] as the basis of another
simple query DateTest1 which queries table DateTest (without linking the
tables).
I have tried using a module (called FinancialYear see below) and used that as
the expression but it will not pull out any records. The vba for the module
is sooo basic!
Public Function FinancialYearEnd()
Set rst = CurrentDb.OpenRecordset("YearDateAct")
End Function
Query DateTest1
SELECT DateTest.EraDate, DateTest.TestNumber
FROM DateTest
WHERE (((DateTest.EraDate)=FinancialYearEnd()));
I know something is wrong but I'm unable to see where!
Hope someone can help.
Regards
NoCanDo
I'm new to Access Monster, but not access. Using Access 2003 and would like
to use the 1st April as the start date for any particular reporting year so
that I can pull out historic data from a much larger dataset.
My very simple query selects a single field record (Date format) from a table
and I want to use that as the basis of another query on another table where
it is used as the Between 'date' And Date().
To simplify matters I created a very two simple tables called:
Temp - Year which contins one field YearStartDate (Date/Time data type)
DateTest which contains two fields: EraDate (Date/Time data type) and
TestNumber (Number data type)
I want to use the [Temp - Year].[YearStartDate] as the basis of another
simple query DateTest1 which queries table DateTest (without linking the
tables).
I have tried using a module (called FinancialYear see below) and used that as
the expression but it will not pull out any records. The vba for the module
is sooo basic!
Public Function FinancialYearEnd()
Set rst = CurrentDb.OpenRecordset("YearDateAct")
End Function
Query DateTest1
SELECT DateTest.EraDate, DateTest.TestNumber
FROM DateTest
WHERE (((DateTest.EraDate)=FinancialYearEnd()));
I know something is wrong but I'm unable to see where!
Hope someone can help.
Regards
NoCanDo