sql - How do I write this query to get back what I need? -


i'm trying write query retrieve columns (what surprise!). i'm horrible other simple queries , in access. below image of query designer in access.

enter image description here

the fields @ bottom fields looking pull back. project_master.contactdesigner foreign key contacts.contactid. want list of milestonenames id's 2, 3 , 4. example, milestoneid 2 has milestonename of project initiation, want have record many projects exists have start , end date in project_milestone_dates milestoneid , list names of contacts each record tied foreign key project_master.contactdesigner. needs grab records have projectpriority of 2 example.

not sure if clear it's hard me explain i'm looking here missing criteria or maybe ids need add query? i'm lost. current design returns nothing in columns.

select milestone_def.milestonename,         contacts.firstname,         priority_def.priorityname,         project_milestone_dates.startdate,         project_milestone_dates.enddate,         milestone_def.milestonedefid    (project_milestone_dates          inner join (priority_def                      inner join (contacts                                  inner join project_master                                          on ( contacts.contactid =                                               project_master.contactdesigner ))                              on priority_def.prioritydefid =                                 project_master.projectpriority)                  on project_milestone_dates.projectid =                     priority_def.prioritydefid)         inner join milestone_def                 on project_milestone_dates.milestoneid =                    milestone_def.milestonedefid   ( ( ( project_master.projectpriority ) = [@priority] )           , ( ( milestone_def.milestonedefid ) = 5                  or ( milestone_def.milestonedefid ) = 6                  or ( milestone_def.milestonedefid ) = 7 ) );  

changed 5 or 6 or 7 that's should be.

edit*

i've removed line and (contacts.contactid = project_master.contactowner) did not need in query.

project_milestone_dates.projectid = priority_def.prioritydefid 

that looks bad join.

shouldn't be?:

project_milestone_dates.projectid = priority_def.projectid 

move project_milestone_date table connects directly project_master, , not priority_def


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -