troubleshooting Question

Access condition not being met

Avatar of programmher
programmher asked on
Microsoft AccessMicrosoft DevelopmentSQL
12 Comments1 Solution234 ViewsLast Modified:
Still working in Access.

My customer has a pre-existing app that needs to be updated so the library title list is updated with various verbiage.

Here is the code:

INSERT INTO NEw_Title_List (title, author, isbn,published_date, importedtitles, titlereceivedwithin10years, titlereceiptdate)
SELECT otitle, oauthor, oisbn,opublished_date, oimportedtitles,  otitlereceivedwithin10years, otitlereceiptdate
Iif (importedtitles = 'Y' AND titlereceiptdate < DateAdd("yyyy", +1, Date()), '10 percent upcharge,
  Iif (importedtitles = 'Y' AND   titlereceivedwithin10years= 'Y'  AND titlereceiptdate < DateAdd("yyyy", -1, Date()), 'no charge'))
FROM old_list1, left join oldlist2 on old_list1.ISBN = oldlist2.ISBN
FROM tbl_library
 
My first condition works - but, my second condition that needs to print "no charge" doesn't!

What am I doing wrong?  

My dates are formatted 'mm/dd/yyyy'
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros