Problem With Birthdays
Dec 28, 2007
I have a query that extracts the month and day of a bowlers birthday for a selected week and year (Done from a form).
The query below works fine until the end of the year when the ScheduleDate crossover to a new year. At that point the query wants to include all of the bowlers birthdays even though I'm only trying to get the month/Day Between 12/31/07 and 01/06/08.
What am i doing wrong?
Hope I'm clear enough!
SELECT tblBowlers.FirstName, tblBowlers.LastName, tblBowlers.BirthDay, Format(DateDiff("yyyy",[BirthDay],[ScheduleDate]),"#") AS BowlerAge, tblSchedules.SeasonID, tblSeasons.Quit
FROM tblSchedules, tblTeams INNER JOIN (tblBowlers INNER JOIN tblSeasons ON tblBowlers.BowlerID = tblSeasons.BowlerID) ON tblTeams.TeamID = tblSeasons.TeamID
GROUP BY tblBowlers.FirstName, tblBowlers.LastName, tblBowlers.BirthDay, tblSchedules.SeasonID, tblSeasons.Quit, tblSchedules.ScheduleDate, tblSchedules.WeekNo
HAVING (((tblBowlers.FirstName)<>"DUMMY") AND ((tblBowlers.LastName)<>"DUMMY") AND ((tblSchedules.SeasonID)=[Forms]![frmYearSelect].[SeasonYearID]) AND ((tblSeasons.Quit)=False) AND ((tblSchedules.WeekNo)=[Forms]![frmWeekSelectExcel].[txtNextWeek]) AND ((Format([BirthDay],"mm/dd")) Between Format([ScheduleDate]-2,"mm/dd") And Format([ScheduleDate]+4,"mm/dd")));
View Replies
Nov 14, 2005
The title tells it all really. I need a way to take a list of records with the field D.o.B in short format e.g. 12/10/1990 and be able to find out who's birthday it will be in the next week. I cant find a way to take the date of birth and search it to find, say the week starting 11/10 and get the dates the next week (so up to 18/10) because of the date of birth not being the current date.
sorry I'm not good at explaining things :o . I'm trying to say getting 12/10/2005 as the date of birth would be no problem as it would fall into the week choosen but 12/10/1990 is not the right year so doesnt appear but I want it to. so I need it to only search for the 12/10 part not the year so I can get the birthdays but I dont know how to achieve this. I'm not sure its possible but I'll probably be told its quite easy.
Typically I want the query to ask the start date of the week that the user enters, and it will find all birthdays from that date to the date 7 days on. although asking for the start date and then what date do I want to stop searching for birthdays (i.e. 'enter first date: 12/10' and 'enter second date: 30/12' then find the birthdays inbetween the dates) would probably be more practical and flexible for future use. I'm not paticularly good with ms access and although looking and searching I cant see a way to achieve this but I cant believe its not possible so any help would be appreciated very much. thanks in advanced if you help me out at all
thanks for reading
View 9 Replies
View Related
Mar 24, 2015
So I found this video (youtube.com/watch?v=FTjyuSTcTII&spfreload=10) and followed it to do a query for all upcoming birthdays. The video shows how to do it for the next two months and I tried to modify it just for the next 7 days. When I tried to run it, I got "Date type mismatch in criteria expression" error. I tried putting it back in the criteria she had, but still got the same thing.
At 6:53 you can find the code she used for the first table (basically asking when their next birthday is) and at 9:57 is the code for the criteria. Below is my modification.
Between Date() And DateAdd("d",7,Date())
View 14 Replies
View Related
Sep 28, 2015
I came up with the following string to do this but I keep getting an error...
Next_months_Birthday: DateSerial(Year(Date())+IIf(Format(Date()),"mmdd") >Format([Month],"00") & Format([Day],"00"),1,0),[Month],[Day])
The error I get is ....The expression you entered contains invalid syntax, or you need to enclose your text data in quotes.
I attached a screen shot ....
View 8 Replies
View Related
Jun 18, 2013
I need to create a guest database for a small hotel. And I would like to create a pop-up alert that appears when I open MS Access to remind me birthdays of the guests.
View 1 Replies
View Related