date diff?

L

Leslie S

Hi,

I'm trying to identify Visa dates that will expire within
the next three months. I have a date field called
VisaExp, but I can't figure out what what critera to use
in my query to deal with both the month and year.

Any help would be most appreciated.

Thanks.

Leslie
 
M

Michel Walsh

Hi,


DateSerial( YearEnd, MonthEnd + 1, 1 ) - 1


<= DateAdd("m", 3, Date( ) )




should do. Note that you can re-write the first expression like:


DateSerial( YearEnd, MonthEnd + 1, 0 )

but may be a little bit less self-evident.

Hoping it may help,
Vanderghast, Access MVP
 
L

Leslie

Thanks, that did it.
-----Original Message-----
.... WHERE [VisaExp] BETWEEN Date() AND DateAdd("m", 3, Date())

--
HTH
Van T. Dinh
MVP (Access)



Hi,

I'm trying to identify Visa dates that will expire within
the next three months. I have a date field called
VisaExp, but I can't figure out what what critera to use
in my query to deal with both the month and year.

Any help would be most appreciated.

Thanks.

Leslie


.
 

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