Originally Posted by
ranman256
use Q1 to pull all records < formdate, but add a field to calculate the dates diff, DaysDiff: DateDiff("d",[dateFld],[formDate])
then Q2, (using Q1) to get the closest date: select Min(DaysDiff) from Q1
Thanks Ranman, first part is working I'm just having issue with selecting the min in the second query.
What exactly do I put in to get the Min(DaysDiff), here is the current SQL:
Code:
SELECT Locals_Selected_Query1.Carrier, Locals_Selected_Query1.[POD Name], Locals_Selected_Query1.[20GP THC], Locals_Selected_Query1.[40GP THC], Locals_Selected_Query1.[40HC THC], Locals_Selected_Query1.[BL Flat Fee], Locals_Selected_Query1.[SEC Fee], Locals_Selected_Query1.[SEC Fee Currency], Locals_Selected_Query1.[Valid From], Locals_Selected_Query1.Notes, Locals_Selected_Query1.DaysDiff
FROM Locals_Selected_Query1;