On 3 Feb 2007 10:11:43 -0800, "lilbit27" <
[email protected]>
wrote:
tara is the name of my table and the is what I have in the qry:
Field TARA.*
Field NetC criteria = 0
Field PendDte criteria Is null
Field EffDateCompare: Year([billeffdte]) & Month([billeffdte])
Criteria: Year(DateAdd("m",-2,[rptdt])) & Month(DateAdd("m",-2,
[rptdt]))
And I went to view the sql stament and it said:
SELECT TARA.*, Year([billeffdte]) & Month([billeffdte]) AS
EffDateCompare
FROM TARA
WHERE (((TARA.NetC)=0) AND ((TARA.PendDte) Is Null) AND
((Year([billeffdte]) & Month([billeffdte]))=Year(DateAdd("m",-2,
[rptdt])) & Month(DateAdd("m",-2,[rptdt]))));
What I am trying do do is write the above statement in the after
update of an option button on a form so that it will filter my
If you're trying to filter by a date field - you *don't* need or want
to construct a text string concatenating years and months. Instead,
use the DateSerial() function to construct a date/time field.
If you want to filter the subform to return any date during the month
two months prior to [rptdt], try
= DateSerial(Year([rptdt]), Month([rptdt]), 1) AND <
DateSerial(Year([rptdt]), Month([rptdt]) + 1, 1)
as a criterion on billeffdte.
John W. Vinson[MVP] - Hide quoted text -
- Show quoted text -