Query Day Criteria

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

I am trying to get a criteria , [tblCompanyInfo.Warning1] is a number field
let say "15" I am trying to filter records 15 days older than
[tblHorseInfo.ServiceDate]

SELECT tblHorseInfo.HorseID, tblHorseInfo.ServiceStallion,
tblHorseInfo.Service1, tblHorseInfo.ServiceDate, qryHorseNameAll.Name,
Format([ServiceDate],"dd-mmm-yy") AS MyDate, tblHorseInfo.Status,
tblCompanyInfo.Warning1
FROM tblCompanyInfo, tblHorseInfo INNER JOIN qryHorseNameAll ON
tblHorseInfo.HorseID = qryHorseNameAll.HorseID
WHERE (((tblHorseInfo.Service1)=0) AND ((tblHorseInfo.Status) Like
"Active"));
 
I Dont believe it, I think Ive done it :)

SELECT tblHorseInfo.HorseID, tblHorseInfo.ServiceStallion,
tblHorseInfo.Service1, tblHorseInfo.ServiceDate, qryHorseNameAll.Name,
Format([ServiceDate],"dd-mmm-yy") AS MyDate, tblHorseInfo.Status,
tblCompanyInfo.Warning1
FROM tblCompanyInfo, tblHorseInfo INNER JOIN qryHorseNameAll ON
tblHorseInfo.HorseID = qryHorseNameAll.HorseID
WHERE (((tblHorseInfo.Service1)=0) AND
((tblHorseInfo.ServiceDate)<Date()-[Warning1]) AND ((tblHorseInfo.Status)
Like "Active"));
 
Back
Top