Ciao!
as I understand you - you can do this with such query:
SELECT tbCalendar.RequestedDate, Max(tbCatalogue.CatalogDate) AS
MostRecentAvailableDate
FROM tbCalendar INNER JOIN tbCatalogue ON tbCalendar.RequestedDate >
tbCatalogue.CatalogDate
GROUP BY tbCalendar.RequestedDate;

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> Hi, I know very little about ACCESS VBA, therefore you are my only
> possibility to get this done... I have posted also in the query groups
[quoted text clipped - 23 lines]
>
> Italy
kayard - 27 Sep 2006 21:54 GMT
Thanks it works !!!
could you plrase help me with VB code as well ?
I need a function whose interface would be:
GetLastDate(input_date)
that would run this query:
SELECT MAX(Date) FROM (SELECT Date FROM tbCatalogue.Date WHERE
tbCatalogue.Date <= input_date)
So I can use the result of this function in the query builder as a
where clause in another query and get the price form tbCatalogue.Price
I need the compete syntax to write in VBeditor ... as I said I'm a N00b
Thanks again for your work
Paolo
Alex Dybenko - 28 Sep 2006 06:37 GMT
Hi Paolo,
you can use DMax function:
DMax("[Date]", "tbCatalogue","[Date] <= " & [input_date])
but if you plan to use it in query - then better to use joins or subquries
for better performance

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> Thanks it works !!!
>
[quoted text clipped - 17 lines]
>
> Paolo