Thank you all for your cooperation
This is what I did
But it did not work
This is my sql after rplace Date() with 2006 after that it worked
SELECT Avg([P&P_tbl].[P&P_%]) AS [Avg], [P&P_tbl].[ID#], [Emp_Courses_tbl
Query].[Sum Of Mark], [Sum Of Mark]/25 AS [% of Course], [Avg]+[% of
Course]/100 AS [Total %]
FROM [Emp_Courses_tbl Query] INNER JOIN [P&P_tbl] ON [Emp_Courses_tbl
Query].[ID#] = [P&P_tbl].[ID#]
WHERE ((([P&P_tbl].Year) Between 2006 And DateAdd("yyyy",-3,Date())))
GROUP BY [P&P_tbl].[ID#], [Emp_Courses_tbl Query].[Sum Of Mark];
> > does not work
>
[quoted text clipped - 5 lines]
>
> Chris O.
Ofer Cohen - 25 Jun 2007 08:19 GMT
Hi Jon,
If the Year field contain only the Year and not a full date, try:
SELECT Avg([P&P_tbl].[P&P_%]) AS [Avg], [P&P_tbl].[ID#], [Emp_Courses_tbl
Query].[Sum Of Mark], [Sum Of Mark]/25 AS [% of Course], [Avg]+[% of
Course]/100 AS [Total %]
FROM [Emp_Courses_tbl Query] INNER JOIN [P&P_tbl] ON [Emp_Courses_tbl
Query].[ID#] = [P&P_tbl].[ID#]
WHERE [P&P_tbl].[Year] Between Year(Date()) And Year(Date())-3
GROUP BY [P&P_tbl].[ID#], [Emp_Courses_tbl Query].[Sum Of Mark]
Note: It's not recomended using build in functions in Access as fields names
(Year - that will return the year from the date).
It will be OK as long that you place it in square brackets, but to avoid
errors and to have to remember puting square brackets, it's better changing
the name.
------
Good Luck
BS"D
> Thank you all for your cooperation
> This is what I did
[quoted text clipped - 18 lines]
> >
> > Chris O.
Jon - 25 Jun 2007 08:58 GMT
hi,
still does not work
> Hi Jon,
> If the Year field contain only the Year and not a full date, try:
[quoted text clipped - 39 lines]
> > >
> > > Chris O.
Ofer Cohen - 25 Jun 2007 09:28 GMT
My mistake, the order in the between should have the small value first
SELECT Avg([P&P_tbl].[P&P_%]) AS [Avg], [P&P_tbl].[ID#], [Emp_Courses_tbl
Query].[Sum Of Mark], [Sum Of Mark]/25 AS [% of Course], [Avg]+[% of
Course]/100 AS [Total %]
FROM [Emp_Courses_tbl Query] INNER JOIN [P&P_tbl] ON [Emp_Courses_tbl
Query].[ID#] = [P&P_tbl].[ID#]
WHERE [P&P_tbl].[Year] Between Year(Date())-3 And Year(Date())
GROUP BY [P&P_tbl].[ID#], [Emp_Courses_tbl Query].[Sum Of Mark]
> hi,
> still does not work
[quoted text clipped - 42 lines]
> > > >
> > > > Chris O.