Query Day Criteria

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"));
 
B

Bob Vance

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"));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top