DateAdd Question

G

Guest

I have to select data where a renewal date falls in the next 90 days. Dateadd
would be perfect except the renewal date is given as MMDD. When I run the
query with Oct, Nov, or Dec the recordset is blank. Any ideas without using
a string if IIFs and/or cases in VBA?
 
D

Duane Hookom

What type of data field are you using to store renewal date? Is it a
date/time field or text? What are some sample values?
 
G

Guest

The field is defined as Number (Integer)

Here are some examples:
05/15
12/30
04/10
09/27
 
J

John Vinson

The field is defined as Number (Integer)

Then it's not a Date. What year is 1105? Can you be ABSOLUTELY certain
that it's this coming November, not last year?

You could use CDate(Format([fieldname], "##/##")) to have it assume
the current year, but this will of course fail for January dates
searched in November or December, since it will assume 2006 not 2007.

I'd *really* recommend using a date field for date information.

John W. Vinson[MVP]
 

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