Need your suggestions (1 Viewer)

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
I built this db for our HR department. When I met with them about the reports one of the ones they wanted was based off the 8 Licensure/Certification fields and the date fields associated with them. They need one report that is going to list the Licensure/Certification and the expiration date for that License so they can notify the employee that has or will be expiring. I am not sure I would build a query that is going to reference 8 date fields. Never have tried anything this complex before.
 

Attachments

  • ContractEmployees.accdb
    768 KB · Views: 55

vbaInet

AWF VIP
Local time
Today, 17:21
Joined
Jan 22, 2010
Messages
26,374
If you're unsure how to write criteria for 8 fields, are you comfortable writing it for 2 date fields?
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
I have defintely written queries where I have done Between[Beginning Date] And [Ending Date] but in this case never for multiple date fields. I do want to get prompted sixteen times when I need to enter it only once.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
Excuse me don't want to prompted sixteen times
 

vbaInet

AWF VIP
Local time
Today, 17:21
Joined
Jan 22, 2010
Messages
26,374
You will get prompted once as long as the parameter name is the same across the 16 fields. So if I wrote [Enter a Date:] as a parameter under 16 fields in a query, it will pop up just once.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
So if I do this Between[Beginning Date:] And [Ending Date:] I should get prompted once?
 

vbaInet

AWF VIP
Local time
Today, 17:21
Joined
Jan 22, 2010
Messages
26,374
That's right. Just make sure to copy and paste it across instead of typing it.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
I tried your suggestion in the query LicExpDate for date 08/31/12 since all three test records have that have that date for some of the License Date field in question. I pull no records when I run it though.
 

Attachments

  • ContractEmployees.accdb
    1.1 MB · Views: 56

JLCantara

Registered User.
Local time
Today, 09:21
Joined
Jul 22, 2012
Messages
335
Hi JMRiddic,

Simple:

Your between functions are all on the same line meaning and between them (check to the left of this line). However, some dates are missing...

On 3 different lines, they wil be ored and it will do the job you're expecting.

JLCantara.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
I actually have 8 date fields I need to check because I have 8 text boxes for License/Certification information and each of those date fields are to be associated with each of those. So will access allow me to do that many lines?
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
I tried what you suggested but now it will not run the query saying its too complex. I will restate the original problem. I need to check 8 license expiration date fields in order to see if any of them fall in the date range I put. I do not need the parameter box to show more than once. Its being suggested to put them on the same line or put them on seperate lines starting on the OR line. Which one is correct?
 

Attachments

  • ContractEmployees.accdb
    1.1 MB · Views: 56

JLCantara

Registered User.
Local time
Today, 09:21
Joined
Jul 22, 2012
Messages
335
Hi JMRiddic,

Tested your last version, and here it works fine. Try this: copy the query text, open a new query and paste the previous text...

JLCantara.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
Ok I see what you mean. I ran it as well. Only problem its repeating the employee more than once if it finds matches on any of those fields. If you try 08/01/12 to 08/31/12 you will see what I mean. I just need them to show once. Suggestions?
 

JLCantara

Registered User.
Local time
Today, 09:21
Joined
Jul 22, 2012
Messages
335
Holly pistol JM what the f... is the duplate table doing there???? That's where your problem is.

JLCantara.
 
Last edited:

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
Not sure what you are meaning. There's only three test records in the database. Duplicate file?
 

JLCantara

Registered User.
Local time
Today, 09:21
Joined
Jul 22, 2012
Messages
335
Check LicenseExpDate: table 'Contract Employees' occurs twice so you end up with the cartesian product of the query result!!!

JLCantara.
 

jmriddic

Registered User.
Local time
Today, 17:21
Joined
Sep 18, 2001
Messages
150
How did I do that? Oh well. Its fixed now. Thanks for the help.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:21
Joined
Feb 19, 2002
Messages
43,314
The queries will be simpler if you normalize the schema. You need at least two tables. All the license data needs to move to a second table where you will have one row per license. That means that you don't need to restrict the list to only 8 or waste the space when a person has fewer or none. You would use a subform to display the licenses.

If the licenses are standard, you could have a third table that lists them. Then rather than storing the text, you could pick from a combo and store the ID. This will make the data more consistant so you can produce meaningful reports by license type. To do that now means you need to rely on the keyboard skills of the people doing the data entry.

Also - best practice would be to remove the special characters and embedded spaces from your column names.
 

JLCantara

Registered User.
Local time
Today, 09:21
Joined
Jul 22, 2012
Messages
335
You'r right Pat, but will you be listened???

JLCantara.
 

Users who are viewing this thread

Top Bottom