Date problem help :s

  • Thread starter Thread starter Raymond van der Meer
  • Start date Start date
R

Raymond van der Meer

Hi,

I 've got a table with some records. In one of the fields there's a date,
I'm trying to get a query wich gives me a selection of records with the
following criteria:

show all the records where DATE = between NOW and 2 months forward.

I've looked everywhere, but haven't got a clue... I don't know VBA, so I
think
it has to be done with expressions.

Can anyone help me or give me a hint? :)

Thanx in advance!

Raymond (the netherlands)
 
Hopefully your field isn't actually named "Date": that's a reserved word,
and using it for your own purposes can lead to problems. If it is named Date
and you can't rename it, you should include square brackets around it in the
SQL.

The criteria would be

WHERE MyDate BETWEEN Date() AND DateAdd("m", 2, Date())

or

WHERE [Date] BETWEEN Date() AND DateAdd("m", 2, Date())

if, as mentioned above, you can't rename the field.

If you're creating the query through the graphical query designer, you'd put
"BETWEEN Date() AND DateAdd("m", 2, Date())" (without the quotes) as the
criteria under the date field.
 
Hi,

I 've got a table with some records. In one of the fields there's a date,
I'm trying to get a query wich gives me a selection of records with the
following criteria:

show all the records where DATE = between NOW and 2 months forward.

I've looked everywhere, but haven't got a clue... I don't know VBA, so I
think
it has to be done with expressions.

Can anyone help me or give me a hint? :)

Thanx in advance!

Raymond (the netherlands)

As criteria in the query's date field:

Between Date() and DateAdd("m",2,Date())
 
It works fine!

Thanks Doug! I'll drink a beer to that ;)

Thanks to Fred too!

Cheers,

Raymond
 
Back
Top