How to find records closest to a specified date

  • Thread starter Thread starter Angela
  • Start date Start date
A

Angela

I have four tables which contain financial data - each for
a different installment. Each table has a primary key which
links the id fields to each other.

I need to run a query which will find the closest
installment equal to or prior to a specified date.

Can anyone help me?
 
Hiya

I managed something quite similar

In my query, I grouped the output by ID and included a where clause to say [installment date]<=[MyDate], in another field I chose the maximum installment date

Now depending what else you want to do with this data, you may want to do another query based on the first one with maybe an outer join to include all those IDs that had nothing before your specified date

I hope this gets you going on the query, but if you need more help, please include more information about your table structures and what exactly you want as an output

Basi

----- Angela wrote: ----

I have four tables which contain financial data - each fo
a different installment. Each table has a primary key whic
links the id fields to each other

I need to run a query which will find the closes
installment equal to or prior to a specified date

Can anyone help me
 
Back
Top