473,569 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query of Customers with Date of Birth in Specific Range

2 New Member
Afternoon all,

I've been battling with this all day today and my brain is now pretty much fried.

I have one table that lists several details about my customers (name, address, phone, date of birth etc).

I want to create a query that will allow me to enter a start date and an end date and will then display the customers who have birthdays within those two dates.

I know I can do this using:

Criteria BETWEEN Forms!NameOfFor m!StartDate AND Forms!NameOfFor m!EndDate

But it's a little more complex because a date of birth also includes a year. I'm not concerned with what year they were born. Just whether or not they have a birth day this year within a specific set of dates.

I guess I have the code correct, and this is more a question regarding table format. How can I query just the date and month and ignore the year of birth?

Thanks!

Jamie
Oct 31 '08 #1
3 3388
nico5038
3,080 Recognized Expert Specialist
Try to use the Format() function to get the "MM/DD" part of the date to compare.
Also the Month() and Day() function could be used.

Nic;o)
Oct 31 '08 #2
jamieharrop
2 New Member
Thanks for the reply, Nic.

I'm really not sure how to do what you suggested. My knowledge of Access is quite basic (I got the code in my initial post from another thread that was listed on here).

Jamie
Oct 31 '08 #3
nico5038
3,080 Recognized Expert Specialist
Try in your query to add a field like:

select format(DOB,"MDD ") as YearMonth from tblPerson;

In the graphical query editor use:
YearMonth:forma t(DOB,"MDD")

Just replace DOB with your Birthdate fieldname.

Nic;o)
Oct 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3055
by: B. Fongo | last post by:
I learned MySQL last year without putting it into action; that is why I face trouble in formulating my queries. Were it a test, then you would have passed it, because your queries did help me solve my problem. I'll turn to MySQL doc after getting through this pressing project. Thanks a lot Roger! Babale -----Urspr=FCngliche...
2
2128
by: Terry | last post by:
I have a database that I would like to query for a specific date range. I want to create a report based on this query that will pull any records from the last 7 days. Is this possible? Can someone tell me how it is done? Thanks.
24
19881
by: clare at snyder.on.ca | last post by:
I have a SQL query I need to design to select name and email addresses for policies that are due and not renewed in a given time period. The problem is, the database keeps the information for every renewal in the history of the policyholder. The information is in 2 tables, policy and customer, which share the custid data. The polno changes...
7
2720
jaccess
by: jaccess | last post by:
Hello, I am fairly new to Access and have been working on this problem for several days now. I don't suspect that the answer I am looking for should be as elucive as it has been. I will attempt to explain the purpose of the query I am trying to make. I am trying to display orders for a specific date range over a 3 year period based on a...
1
1773
by: gelpaks | last post by:
My problem is a bit long and involved, but I will try to summarize. I have created a database using Access 2000 for a cemetery and it now is populated with almost 6,000 names. I created a form so entries could easily be put in the table. In the Before_Update, I put this code to search for duplicates: 'check if last name, first name, and...
5
2813
by: ladybug via AccessMonster.com | last post by:
I am trying to create a report using multiple tables. The first table has Employee info in it (name and id's). the next three tables have employee info for training, test, scores, etc. I am having trouble in how to set up a report to capture all the of the tables for one specific employee and for a date range. If I create the report...
5
1515
by: isoquin | last post by:
Given: tblPurchase contains: customerID dtePickup 'estimated date a customer will return to the shop tblPickup contains: dteArrived 'the actual date the customer returned status 'set to "pickup complete" or "will return another day"
4
2845
Sandboxer
by: Sandboxer | last post by:
I want to be able to program Access to provide for me, by individual day, what my contract obligations are to my customers. Will Access recognize all the individual days in between a date range (simply a "from" date and a "to" date)? Additionally, I need to delivery a specific quantity of product when the customer's inventory is within about...
11
2631
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.