Between Dates Query on Multiple Fields

I understand Bob. I'm sticking around though, if you don't mind. And to show that I really do actually care, here is something for the OP:

You need this:

Table1
NameID = PK autonumber
Name = name of person

Table2
TrainingID = PK autonumber
TrainingName = forklift, crane, etc...(these types)
NameID = FK (ID of person in table 1)
Completion DATE = this is obvious



After you get this rearranged, you can build your query, and thus your report in a block style, just like u want. Query SQL will be something like this:
Code:
SELECT table1.nameID, table1.name, table2.trainingname,
  table2.completionDATE FROM table1
  INNER JOIN table2 ON nameID = nameID
that is an example of the code that will pop out if you just create those tables with the relationships that are specified above.

and BTW, the word "NAME" is reserved, so don't use it to "name" any field in a table. ;) The reason is irrelvant, just don't.

I added the third table to avoid duplication of the Training Names in Table 2. I assumed that each person has the right and opportunity to take each training, and therefore there would be significant duplication.
 
LOL Rabbie! Thanks for everyone's insight, and I apologize for starting the argument. Facts are facts. I will get out. Let us let the OP figure it out now. ;) I think we've done enough arguing. After all, I'm the new guy here. Take it easy on me. I'm inexperienced and stupid.

You are most likely neither of the above. You do however (in this instance), have an opinion that differs from the one held by many of the experts supporting AWF, and therefore are likely receive second (and perhaps third or more) opinions when you post a reply.

It has been said that there is almost always more than one way to do the same thing in Access, and we seem to have enough experts here at AWF to provide different options to the people looking for assistance.

Please continue to hang out and reply. We can all learn from each other and in the end become better at what we do.
 
Please continue to hang out and reply. We can all learn from each other and in the end become better at what we do.
Not a problem. My apologies for interfering with AWF. I know you guys are experts. ;) And I also know that you look at whatever I write on here. And to all that were watching this show, SHOW'S OVER. ;)
 
Not a problem. My apologies for interfering with AWF. I know you guys are experts. ;) And I also know that you look at whatever I write on here. And to all that were watching this show, SHOW'S OVER. ;)

Rats! Just when I thought the channel had changed from a Drama/Sitcom Channel to an Educational Channel. :D
 
I don't fully understand what you mean. Also, I would like to run one report/query to show training due next month for all employees.

Will atempt your suggestion anyway.
Thanks
Mich

Ok, I assumed from the beginning that your tables are "normalized". It'd be helpful if you'd load some of 'em up here so I (and others) can take a look.

If your tables are ok, then it's quite easy to generate a report with training due next month (or whenever, for that matter). Just add a combo on the pop up form, where one can choose a month, then add the following to the button code: " AND Month(DueDate) =" & Me.cboMonth"

HTH
 
MarleyManner1

You are what would be called a "troll" in any other forum. You express an opinion contrary to 99% of the rest of the senior forum members and then blow off the idea that we might know what we are doing. And you express insults to those who call you down. I don't doubt that you'll call ME down too, but that's OK, I've been called worse by better programmers. I've got to say, your ideas don't really work too well in the real world.

First, if you prove to your boss that you know what you are doing, you don't get fired as often as you get another, perhaps tougher assignment. Because in any field of work, it isn't who you are that gets you a salary, it is what you show you can do. If you were my employee, that relationship wouldn't last long because it would be obvious to me that you don't want to do anything useful.

Second, you've got a crazy idea about normalization. When you take the time to normalize your DB, this lets you code things faster because relational databases have tools built in to make things more efficient once you have normalized. You can write code faster. You can build complex, multi-table queries faster. You can tack together parent/child forms faster. You can create sub-reports faster. You can avoid intractable data searches more often. (Case in point, normalization would quickly solve the problem described by mrenwick.)

Third, I can't speak for Bob, but I bring over 30 years of programming experience and at least 25 of those years include databases of one flavor or another. I wouldn't tell you this if I didn't believe in it. Normalization will save your nether anatomy when you get it in a bind. It has done so for me at least four and maybe five times in major projects - and I've built code that has run in 30+ states in the USA and at least six countries around the world.

So if you want to insult me, go ahead. But I'll tell you right now, we have a word for folks with your attitude. Unemployable. Your only saving grace was that you finally backed down when enough folks told you that your views on normalization were wrong. But you still showed very ill manners and a lack of understanding in your answer to Bob.
 
I added the third table to avoid duplication of the Training Names in Table 2. I assumed that each person has the right and opportunity to take each training, and therefore there would be significant duplication.

I am still trying to get this query to work, sorry to play the dumb blonde here but, the Completion date that you mention does this have to be a separate field for each type of training? At the moment I have a column for each training with a date in it.
 

Users who are viewing this thread

Back
Top Bottom