Queries with dates..

K

KM

Can anyone help me with a date based query?
I have two tables:
PriceChange| PriceChangeID; Date; Amount; ProductID
Product| ProductID; ProductName

I want to select the most recent date from Pricechange that matches a
specific product ID (ie the current price)

I also want to provide a date and have a query that finds the record with
the closest date before the date supplied.

I recon a module that has an optional date field should do the trick, but I
dont know
how to write the actual sql

Thanks in advance for any help,
KM
 
Top