Properly calling a parametrized query from another query

K

kayard

Hi,

I hope somebody can help me because I'm going slightly mad trying to
figure out how to properly call a parametrized access query from
another query. I must foresay that I have googled looking for an answer
but i havent find anything that solved the problem.

By the way I'm true n00b so ...

I have a query which takes a date as a parameter and shows the most
current price relative to the parameter:

Query GetMostRecentPrice:

SELECT tbPrices FROM tbPrices.Prices WHERE tbPrices.Date = ( SELECT
MAX(Date) FROM tbPrices.Date WHERE tbPrices.Date < [parameter] )

Then I have another query where the first collum is a Date (coming from
a table named tbCalendar) and the second collum should be (this is what
I'm trying to do) the value returned from the query GetMostRecentPrice.

How to do this in SQL ? What syntax should I use to properly call the
firs query from the second passing the parameter ?

If it were a C function I would do something like this
=GetMostRecentPrice(parameter) but how to do this in access ?

Thanks for any help

Paolo

Italy
 
Top