Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access Table Design
Dates problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Frank, post: 2572013"] Let's say your table is called tblPeople and it has these fields: strHisName dtmHisDoB strHerName dtmHerDoB First, create and save a query called qryComingBirthdays_0 with this SQL: SELECT strHisName AS strName, Day(dtmHisDoB) AS d, Month(dtmHisDoB) AS m FROM tblPeople UNION ALL SELECT strHerName AS n, Day(dtmHerDoB) AS d, Month(dtmHerDoB) AS m FROM tblPeople; Next, create and save a query called qryComingBirthdays with this SQL: SELECT strName, IIf([m]<Month(Now()),CDate(CStr([d]) & "/" & CStr([m]) & "/" & CStr(Year(Now())+1)),CDate(CStr([d]) & "/" & CStr([m]) & "/" & CStr(Year(Now())))) AS dtmDate FROM qryComingBirthdays_0 WHERE (((IIf([m]<Month(Now()),CDate(CStr([d]) & "/" & CStr([m]) & "/" & CStr(Year(Now())+1)),CDate(CStr([d]) & "/" & CStr([m]) & "/" & CStr(Year(Now())))))<Now()+30)); qryComingBirthdays will give you the names and birthday dates over the next 30 days. Please let me know how you go with this at [email]RemoveThis.PremierSoftware@Bigpond.com[/email] [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access Table Design
Dates problem
Top