Year(Number) And Date(Number) input to date range output

C

Connie

I'm not sure I understand your entire question, but I can
help with certain aspects of it.

First, the DatePart function can pull out just the month
or the year of a date as a separate field. You can even
use this in a query and sort or compare using just these
parts of a date

ie. If DATE is the field (you realy should not use this
name for a field...because Access uses DATE as a keyword
for the system date). Lets call it INPUTDATE as
1/16/1997.

DatePart ("yyyy", [INPUTDATE]) will give you 1997.
DatePart ("m", [INPUTDATE]) will give you 01.

Use this as a query field by typing "YEAR: DatePart
("yyyy", [INPUTDATE])". As I mentioned the query can use
this field to sort by.

Use a form to collect the input so that you can use the
DatePart And DateAdd functions to prepare a separate set
of fields that you can feed into the query criteria.

For example, they enter 1997 and 4.
Begin with date 1/1/0000.
-Use DateAdd to add 1997 years to this 1/1/1997
-Use DateAdd to add 4 months 4/1/1997
That's your beginning date criteria

-Use DateAdd to add 1 month to this 5/1/1997
-Use DateAdd to subtract 1 day 4/30/1997

Don't know if any of this helps but maybe it'll start you
on the correct tract
 

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