Date Parameter - Desperate for HELP!!!!!!!!


G

Guest

How do I setup a parameter in a query for start and end dates on a bithday
field based on just the month and day of the birthday field?

Example Birthdates: 01/01/06; 02/01/06, 01/31/05, 06/01/69

If user imputs range as start date of 01/01/90 and end date of 01/31/2007, I
need to return records with birthday of 01/01/06 and 01/31/05 regardless of
year.
 
Ad

Advertisements

F

fredg

How do I setup a parameter in a query for start and end dates on a bithday
field based on just the month and day of the birthday field?

Example Birthdates: 01/01/06; 02/01/06, 01/31/05, 06/01/69

If user imputs range as start date of 01/01/90 and end date of 01/31/2007, I
need to return records with birthday of 01/01/06 and 01/31/05 regardless of
year.

Regarding: >based on just the month ** and day ** of the birthday
field<
Do you not want records where the date of birth is not on the 1st or
31st day. Your post suggests you do not.

I think you really want all records for the month. It's the most
logical assumption.

You don't need a start and end date.
All you need is the month.

Add a new column to the query grid:
Birthday:Month([DateOfBirth])

As criteria on this new column, write:
[What month number?]

Enter 1 or 2 or .. 12

Only records where the [DateOfBirth] is in that month will be
returned.
 
G

Guest

Your assumption was correct Fred. But if they only want to return the
birthday for a two week period, 01/07/?? through 01/21/?? it will return all
01 Birthdays. I need to only return records that fall within the range
entered, again regardless of year.

fredg said:
How do I setup a parameter in a query for start and end dates on a bithday
field based on just the month and day of the birthday field?

Example Birthdates: 01/01/06; 02/01/06, 01/31/05, 06/01/69

If user imputs range as start date of 01/01/90 and end date of 01/31/2007, I
need to return records with birthday of 01/01/06 and 01/31/05 regardless of
year.

Regarding: >based on just the month ** and day ** of the birthday
field<
Do you not want records where the date of birth is not on the 1st or
31st day. Your post suggests you do not.

I think you really want all records for the month. It's the most
logical assumption.

You don't need a start and end date.
All you need is the month.

Add a new column to the query grid:
Birthday:Month([DateOfBirth])

As criteria on this new column, write:
[What month number?]

Enter 1 or 2 or .. 12

Only records where the [DateOfBirth] is in that month will be
returned.
 
F

fredg

Your assumption was correct Fred. But if they only want to return the
birthday for a two week period, 01/07/?? through 01/21/?? it will return all
01 Birthdays. I need to only return records that fall within the range
entered, again regardless of year.

fredg said:
How do I setup a parameter in a query for start and end dates on a bithday
field based on just the month and day of the birthday field?

Example Birthdates: 01/01/06; 02/01/06, 01/31/05, 06/01/69

If user imputs range as start date of 01/01/90 and end date of 01/31/2007, I
need to return records with birthday of 01/01/06 and 01/31/05 regardless of
year.

Regarding: >based on just the month ** and day ** of the birthday
field<
Do you not want records where the date of birth is not on the 1st or
31st day. Your post suggests you do not.

I think you really want all records for the month. It's the most
logical assumption.

You don't need a start and end date.
All you need is the month.

Add a new column to the query grid:
Birthday:Month([DateOfBirth])

As criteria on this new column, write:
[What month number?]

Enter 1 or 2 or .. 12

Only records where the [DateOfBirth] is in that month will be
returned.

No problem.
Instead of the column asking for the month, add a different column.

BirthdayRange:Format([DateOfBirth],"mm/dd")

As criteria on this column, write:
Between [From mm/dd] and [To mm/dd]

When prompted for From, enter 01/07 and then enter 01/21 when
prompted for To.
 
Ad

Advertisements

G

Guest

Perfect. That worked just like I need. Appreciate all your assitance Fred.



fredg said:
Your assumption was correct Fred. But if they only want to return the
birthday for a two week period, 01/07/?? through 01/21/?? it will return all
01 Birthdays. I need to only return records that fall within the range
entered, again regardless of year.

fredg said:
On Tue, 8 May 2007 11:13:17 -0700, dh1069 wrote:

How do I setup a parameter in a query for start and end dates on a bithday
field based on just the month and day of the birthday field?

Example Birthdates: 01/01/06; 02/01/06, 01/31/05, 06/01/69

If user imputs range as start date of 01/01/90 and end date of 01/31/2007, I
need to return records with birthday of 01/01/06 and 01/31/05 regardless of
year.

Regarding: >based on just the month ** and day ** of the birthday
field<
Do you not want records where the date of birth is not on the 1st or
31st day. Your post suggests you do not.

I think you really want all records for the month. It's the most
logical assumption.

You don't need a start and end date.
All you need is the month.

Add a new column to the query grid:
Birthday:Month([DateOfBirth])

As criteria on this new column, write:
[What month number?]

Enter 1 or 2 or .. 12

Only records where the [DateOfBirth] is in that month will be
returned.

No problem.
Instead of the column asking for the month, add a different column.

BirthdayRange:Format([DateOfBirth],"mm/dd")

As criteria on this column, write:
Between [From mm/dd] and [To mm/dd]

When prompted for From, enter 01/07 and then enter 01/21 when
prompted for To.
 

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