memilanuk
Registered User.
- Local time
- Today, 08:45
- Joined
- Apr 8, 2009
- Messages
- 33
I'm guessing that I'm missing something blindingly obvious here, but I could use a nudge (okay, shove) in the right direction.
I have a table with various member information... one field being 'Date Expires' and two more being 'Regular' and 'Life' (both Yes/No). What I want is to be able to show all the current active members, including both the Life members and all the Regular members with a 'Date Expires' after a certain date.
One query, which uses 'Life' = Yes as the criteria, works fine. It returns the 120 Life members that I would expect. This is the SQL version of that query:
The second query uses Regular = Yes and 'Date Expires' > DateSerial(Year(Date(),1,1) to return any Regular member with 'Date Expires' after 01/01/2010 (about 40 total):
I'm not really sure at this point what I need to do. Most of my attempts have failed in one fashion or another; I can't seem to combine the two queries above and get the expected ~160 records. Seems like it'd be easier via SQL than via the Query Builder, but I keep getting lost in all the ()
TIA,
Monte
I have a table with various member information... one field being 'Date Expires' and two more being 'Regular' and 'Life' (both Yes/No). What I want is to be able to show all the current active members, including both the Life members and all the Regular members with a 'Date Expires' after a certain date.
One query, which uses 'Life' = Yes as the criteria, works fine. It returns the 120 Life members that I would expect. This is the SQL version of that query:
Code:
SELECT Members.[Last Name], Members.[First Name], Members.[Mid Init], Members.[Card Number]
FROM Members
WHERE (((Members.Life)=Yes))
ORDER BY Members.[Last Name] DESC , Members.[First Name] DESC , Members.[Mid Init] DESC , Members.[Card Number] DESC;
The second query uses Regular = Yes and 'Date Expires' > DateSerial(Year(Date(),1,1) to return any Regular member with 'Date Expires' after 01/01/2010 (about 40 total):
Code:
SELECT Members.[Last Name], Members.[First Name], Members.[Mid Init], Members.[Card Number], Members.[Date Joined], Members.[Date Expires]
FROM Members
WHERE (((Members.[Date Expires])>DateSerial(Year(Date()),1,1)) AND ((Members.Regular)=Yes))
ORDER BY Members.[Last Name] DESC , Members.[First Name] DESC , Members.[Mid Init] DESC , Members.[Card Number] DESC;
I'm not really sure at this point what I need to do. Most of my attempts have failed in one fashion or another; I can't seem to combine the two queries above and get the expected ~160 records. Seems like it'd be easier via SQL than via the Query Builder, but I keep getting lost in all the ()
TIA,
Monte