Query to show expiraton dates is pulling up Blank

  • Thread starter Ronnie O via AccessMonster.com
  • Start date
R

Ronnie O via AccessMonster.com

I am trying to create a query that will pull up the exp dates with this code
<=DateAdd("d",+30,Date()) this shows that their license will expire within 30
days of the current date. My problem is I have 5 categories and I am using
the or function and skipping each line but it doesn't pull up anything. The
information comes from 2 tables linked by emp number the second table is the
credential table which holds the information for their various licenses and
the expiration dates. My goal is to create a query that will show them when
they are 30 days from expiring. My code for the date part works fine.
Provided I only pull up one license at a time. How can I pull up something
that will show all the licenses at once if they are 30 days from expiring?

Here is the SQL view:

SELECT [ECMOEMP].[LName], [ECMOEMP].[FName], [ECMOEMP].[Emp_ID], [ECMOEMP].
[Title], [ECMOCredentials].[TNLicEXP], [ECMOCredentials].[PALSEXP],
[ECMOCredentials].[BLSEXP], [ECMOCredentials].[NRPEXP], [ECMOCredentials].
[ACLSEXP], [ECMOEMP].[In_Active]
FROM ECMOEMP LEFT JOIN ECMOCredentials ON [ECMOEMP].[Emp_ID]=[ECMOCredentials]
..[Emp_ID]
WHERE ((([ECMOCredentials].[TNLicEXP])<=DateAdd("d",+30,Date()))) Or (((
[ECMOCredentials].[PALSEXP])<=DateAdd("d",+30,Date()))) Or (((
[ECMOCredentials].[BLSEXP])<=DateAdd("d",+30,Date()))) Or ((([ECMOCredentials]
..[NRPEXP])<=DateAdd("d",+30,Date()))) Or ((([ECMOCredentials].[ACLSEXP])
<=DateAdd("d",+30,Date()))) And ((([ECMOEMP].[In_Active]) Is Null));


Why won't it pull anyone up. I purposely went in and changed a date so I know
that there should have been something coming up.
 
G

Guest

Are all of the dates populated? I.e., no possibility of a date being null?
Also, is it possible that the 'AND (ECMOEMP.In_Active) Is Null' clause
defeats everything else?

Let us know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top