Access 2010 query

This currently works and is close but not exactly what I need.  I need a list of people who's membership expires at the end of the current year

SELECT Table1.First, Table1.Last, IIf(Right([Table1]![ALU Life],2)<"14","Yes","No") AS Expires, Table1.[ALU Life]
FROM Table1
WHERE (((IIf(Right([Table1]![ALU Life],2)<"14","Yes","No"))<>"No") AND ((Table1.[ALU Life])<>"Y" And (Table1.[ALU Life])<>"N") AND ((Table1.[Dues '13])<>0))
ORDER BY Right([Table1]![ALU Life],Len([Table1]![ALU Life])-2), Table1.[ALU Life];

Because the year (14 above) is hard coded I've been trying to get this to work and keep getting an error....

What I want to do is change IIf(Right([Table1]![ALU Life],2)<"14","Yes","No") AS Expires such that it checks for the current year+1.  In the example above that is the check for <14(for 2014).

I've tried to use Year(Now()) +1 but that is an int and ALU Life is a string and errors.  I've tried to convert the string to an int and compare and I can't get it to work.  I've tried to go the other way and convert Year(Now()) +1 to a string and had no success with that either.

For whatever can be done I need to compare only the right most digits of the year(14 in 2014) like I did with ALU Life above.

Any suggestions?

Thanks
JoppaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SharathData EngineerCommented:
try this.
SELECT Table1.First, Table1.Last, IIf(Right([Table1]![ALU Life],2)<Format(now(), "yy")+1,"Yes","No") AS Expires, Table1.[ALU Life]
FROM Table1
WHERE (((IIf(Right([Table1]![ALU Life],2)<Format(now(), "yy")+1,"Yes","No"))<>"No") AND ((Table1.[ALU Life])<>"Y" And (Table1.[ALU Life])<>"N") AND ((Table1.[Dues '13'])<>0))
ORDER BY Right([Table1]![ALU Life],Len([Table1]![ALU Life])-2), Table1.[ALU Life];

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JoppaAuthor Commented:
That worked.  Thanks for the help.  I was close once but not close enough.
0
SharathData EngineerCommented:
Are you still facing any issue?
0
JoppaAuthor Commented:
Not on this issue.  I'll open a new topic for my other question.  Thanks again for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.