I have a report that requires the user to enter the date of a membership meeting. As it is currently, the report takes the date entered and subtracts 3 days and uses the two dates for the range.
I'd like the report to make it subtract 3 days only if the date entered by the user is a Monday, and to subtract 2 days if the day of the week is Wednesday or Friday. If the date entered is any other day of the week an error message stating that would be nice, but is not a requirement.
The SQL for the query looks like this:
SELECT 'Expired' As [Type], ExpiredMembers.FirstName, ExpiredMembers.MiddleName, ExpiredMembers.LastName, ExpiredMembers.DateUpdated, ExpiredMembers.MemberID, #1/1/1900# As DateJoined, #1/1/1900# AS DateExpired, ExpiredMembers.DL AS [TDL\DL]
FROM ExpiredMembers
WHERE (((ExpiredMembers.DateUpdated)>=DateAdd("d", -3, [Retrieve members since what date?]) And (ExpiredMembers.DateUpdated)<= [Retrieve members since what date?]))
UNION SELECT 'Added' AS [Type], Members.FirstName, Members.MiddleName, Members.LastName, NULL As DateUpdate, Members.MemberID, Members.DateJoined, Members.DateExpired, Members.TDL AS [TDL\DL]
FROM Members
WHERE (((Members.DateJoined)>=DateAdd("d", -3, [Retrieve members since what date?]) And (Members.DateJoined)<=[Retrieve members since what date?]))
ORDER BY Type DESC , MemberID;
Thanks,
Herbal
I'd like the report to make it subtract 3 days only if the date entered by the user is a Monday, and to subtract 2 days if the day of the week is Wednesday or Friday. If the date entered is any other day of the week an error message stating that would be nice, but is not a requirement.
The SQL for the query looks like this:
SELECT 'Expired' As [Type], ExpiredMembers.FirstName, ExpiredMembers.MiddleName, ExpiredMembers.LastName, ExpiredMembers.DateUpdated, ExpiredMembers.MemberID, #1/1/1900# As DateJoined, #1/1/1900# AS DateExpired, ExpiredMembers.DL AS [TDL\DL]
FROM ExpiredMembers
WHERE (((ExpiredMembers.DateUpdated)>=DateAdd("d", -3, [Retrieve members since what date?]) And (ExpiredMembers.DateUpdated)<= [Retrieve members since what date?]))
UNION SELECT 'Added' AS [Type], Members.FirstName, Members.MiddleName, Members.LastName, NULL As DateUpdate, Members.MemberID, Members.DateJoined, Members.DateExpired, Members.TDL AS [TDL\DL]
FROM Members
WHERE (((Members.DateJoined)>=DateAdd("d", -3, [Retrieve members since what date?]) And (Members.DateJoined)<=[Retrieve members since what date?]))
ORDER BY Type DESC , MemberID;
Thanks,
Herbal