Birthdays

Khartoum

Registered User.
Local time
Today, 20:56
Joined
Jan 23, 2012
Messages
25
I have a query which tells me when a persons birthday is no matter what year they were born (i.e. based on dd-mmm), but I would like to expand that so I can find birthdays in the week or fortnight ahead, can somebody assist, current SQL:

SELECT tblClients.ClientName, tblClients.Address1, tblClients.PostCode, tblClients.ContactNumber, tblClients.Email, tblClients.Mobile, tblClients.Birthday
FROM tblClients
WHERE (((Format([tblclients].[birthday],'dd mmm'))=Format(Date(),'dd mmm')))
GROUP BY tblClients.ClientName, tblClients.Address1, tblClients.PostCode, tblClients.ContactNumber, tblClients.Email, tblClients.Mobile, tblClients.Birthday;

regards Kh
 
You could use the DateAdd function here. Would look something like;

Where (DateAdd("d", 14, Date()) - [tblClients].[Birthday]) <= 14
 
i came accross this post and it has helped me greatly. i am trying to find the birthdays that are coming up in the specified criteria.

could someone help me with this as it only give results that are the same day. ie. today is the 15th so it is only returning birthdays that are on the 15th.

SELECT [FirstName]+[Surname] AS [Client Name], Format([DateOfBirth],'dd mmm') AS [Next Birthday], DateDiff('yyyy',[tblClientDetails]![DateOfBirth],Date())+1 AS AgeOnNextBirthday
FROM tblClientDetails
WHERE (((Format([DateOfBirth],'dd mmm')) Between Format(Date(),'dd mmm') And Format([Forms]![rptReportsMainScreen]![txtDateTo],'dd mmm')));
 

Users who are viewing this thread

Back
Top Bottom