Rabu, 29 Juli 2015

Re: [MS_AccessPros] Query for unmatched with two parameters

 

Hi John. I am sorry for the late response. Work has been crazy and this is the first  day I'll get to work on this.

A sales rep is available if he doesn't have any activity on a given day. 

The tblActivities has the Dept info because a sales rep from any of four departments can bring in an activity. So we keep the originating rep and their Dept with the activity info.  The tblRepCmbd table is the list if all reps in all departments. This is in a separate table because one activity can have more than one rep.

Did I set up my tables wrong?

Karen

Sent from my Verizon Wireless 4G LTE DROID


"John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:

 

Karen-


Clear as mud.  😃

What defines an available sales rep?  Is the rep available if there is no activity logged for the specified date?

What is in tblRepsCmbd?  It seems strange that you have outer joined this with activities, yet it has a rep name in it and no department info.  Isn't there a separate table that lists all reps and their departments?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jul 26, 2015, at 10:37 PM, k2j1203@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hello everyone.  I hope everyone is doing well.  I'm stuck on a query that I'm trying to create.


I want to create a query where an user can type in a date and department and have the query results be all of the sales reps that are available for that date.  I have two tables: tblActivities and tblRepsCmbd.  They are left joined on tblActivities.ActivityID_PK to tblRepsCmbd.ActivityID_FK.  The field that I want to have the user enter the date is tblActivities.ActivityDate.  The field for department is tblActivities.Dept.  The sales reps names are in tblRepsCmbd.RepName field.


Let me know if you need more information.


Thanks so much.


Karen


__._,_.___

Posted by: Karen <k2j1203@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar