Hello,
When I run this particular query I get some strange results - I think I know why but I'm not sure of how to correct.
This query should pull records older (based on the RecdDt) than the number entered in a textbox on a form (frmAgedOptions ). When I enter "1" in the textbox on the form, all results return; when I enter any other number, the correct results return based on age, but only for the current year (i.e. anything that fits the age criterion but has a RecdDt in 2007 does not appear).
Any help is much appreciated - Access 2003 - thanks!
qryAgedNotices
[CODE=sql]SELECT tblNoticeBase.N oticeID, tblNoticeBase.C lientID, tblNoticeBase.C lientName, tblNoticeBase.R ecd, tblNoticeBase.S tatus, tblNoticeBase.L ocation, tblNoticeBase.A ssignedTo, (DateDiff("d",[recd],Now())) AS Age
FROM tblNoticeBase
WHERE (((tblNoticeBas e.Status)="U") AND (((DateDiff("d" ,[recd],Now())))>= [Forms]![frmAgedOptions]![txtCriteria]))
ORDER BY (DateDiff("d",[recd],Now())) DESC;[/CODE]
When I run this particular query I get some strange results - I think I know why but I'm not sure of how to correct.
This query should pull records older (based on the RecdDt) than the number entered in a textbox on a form (frmAgedOptions ). When I enter "1" in the textbox on the form, all results return; when I enter any other number, the correct results return based on age, but only for the current year (i.e. anything that fits the age criterion but has a RecdDt in 2007 does not appear).
Any help is much appreciated - Access 2003 - thanks!
qryAgedNotices
[CODE=sql]SELECT tblNoticeBase.N oticeID, tblNoticeBase.C lientID, tblNoticeBase.C lientName, tblNoticeBase.R ecd, tblNoticeBase.S tatus, tblNoticeBase.L ocation, tblNoticeBase.A ssignedTo, (DateDiff("d",[recd],Now())) AS Age
FROM tblNoticeBase
WHERE (((tblNoticeBas e.Status)="U") AND (((DateDiff("d" ,[recd],Now())))>= [Forms]![frmAgedOptions]![txtCriteria]))
ORDER BY (DateDiff("d",[recd],Now())) DESC;[/CODE]
Comment