philpbm
08-21-2011, 09:34 AM
I have a database with a table (memberdetails). I would like a user to run a monthly report to download all member records whose birthdays fall between the first and last day of the following month. The user will input a StartDate, e.g. 01/09/2011 and EndDate e.g. 30/09/2011. Both dates are input using dtpicker. I would like a query to extract all member details whose birthdays fall between 01/09 and 30/09 and display the birthdays only as day and month.
I am ok with the SELECT part of the query but the WHERE part is giving me problems. How can I write the WHERE part so that I use the day and month parts only of the short date to extract the data. Please see what I have at the moment:
WHERE ((tblMemberDetails.([DateofBirth],"dd mm",0,0)) Between [forms]![frmStatusReports]![frmDateSelection]!([BeginningDate],"dd mm",0,0) And [forms]![frmStatusReports]![frmDateSelection]!([EndingDate],"dd mm",0,0));
I am ok with the SELECT part of the query but the WHERE part is giving me problems. How can I write the WHERE part so that I use the day and month parts only of the short date to extract the data. Please see what I have at the moment:
WHERE ((tblMemberDetails.([DateofBirth],"dd mm",0,0)) Between [forms]![frmStatusReports]![frmDateSelection]!([BeginningDate],"dd mm",0,0) And [forms]![frmStatusReports]![frmDateSelection]!([EndingDate],"dd mm",0,0));