"Course2" threw up an error but removing the 2 meant I got results.
oh yeah my bad...
i'd just try and use asteriskes to keep it simple...try
SELECT Course.*,CourseType.*,CourseEvent.*,Location.*
FROM ((( Course
JOIN
CourseType ON Course.[CourseTypeID] = CourseType.[ID] )
JOIN
CourseEvent ON Course.[ID] = CourseEvent.CourseID )
JOIN
Location ON Location.[ID] = CourseEvent.CourseLocation )
try to join in one table at a time... can't remeber the exact syntax w/o analyser
That executes fine. Any more to throw at it?
FROM'
Course, CourseEvent, '
Course RIGHT OUTER JOIN '
CourseEvent ON Course.ID = CourseEvent.CourseID, '
Location, PQE, CourseType, RoleCourse, GroupCourse, DelegateType, Role, [Group], Responsibility '
Course LEFT OUTER JOIN '
CourseEvent ON Course.ID = CourseEvent.CourseID AND CourseEvent.Deleted = 0 INNER JOIN '
GroupCourse ON GroupCourse.CourseID = Course.ID AND GroupCourse.CourseID = Course.ID INNER JOIN '
[Group] ON GroupCourse.GroupID = [Group].ID INNER JOIN '
PQE ON Course.PQEID = PQE.ID INNER JOIN '
CourseType ON Course.CourseTypeID = CourseType.ID INNER JOIN '
ResponsibilityCourse ON ResponsibilityCourse.CourseID = Course.ID INNER JOIN '
Responsibility ON ResponsibilityCourse.ResponsibilityID = Responsibility.ID INNER JOIN '
Responsibility ON Course.ResponsibilityID = Responsibility.ID INNER JOIN '
RoleCourse ON Course.ID = RoleCourse.CourseID INNER JOIN '
DelegateType ON Course.DelegateTypeID = DelegateType.ID INNER JOIN '
Role ON RoleCourse.RoleID = Role.ID LEFT OUTER JOIN '
Location ON Location.ID = CourseEvent.CourseLocation '
you see the gist of what i'm doing, linking in the tables?
just link them all in
then after that works, worry about your joins.. you may have it easy and only need inner joins
you could always link all the tables into access and use query builder...then read off the SQL (it will be JET SQL but it's fairly similar)
oh and with the asteriskes, you'll be selecting loads of fields, you may want to select less
I do see the gist, just that eventually the results produced get minimal - I guess this is where the left, right joins come in?
oh if the results are getting minimal then i need to worry about the joins...urk
tell you what...
link all the tables into access, copy them from linked tables into normal tables then email the .mdb ?
aren't i nice!
If only I had access on my machine!
They aren't that big.
I have SQL Server Management Studio and SQL Server Business Intelligence Development Studio. Any good or do I really need access?
email me the tables, either as text files or in a spready
i'll build it in access you and email you the sql (it'll be Jet SQL though)
oh, i'll PM my email
As you agent your fee is £100 per hour or part thereof and my fee is 20%
I had to go into Waterstone at lunch to get a uni book.
I noticed SQL For Dummies and this thread came immediately to mind
you setting me up as a limited company then? and doing my admin?
i have "SQL in 5 minutes" (N.B. small print says 5 minutes a chapter)
it's probably about a 30 minute job...if i had sql server and the tables in front of me...i quite enjoy transact-sql
As your agent I won't insist that I deal with a UK registered Company.
SELECT Course.ID, Course.Title, Course.Outline, Course.CPD, Course.Presenter, Course.Timings, Course.Compulsory, CourseEvent.CourseLocation, CourseEvent.CourseDate, CourseEvent.CourseTime
FROM (((((((Course RIGHT JOIN CourseEvent ON Course.ID = CourseEvent.CourseID) LEFT JOIN GroupCourse ON Course.ID = GroupCourse.CourseID) LEFT JOIN [Group] ON GroupCourse.GroupID = Group.ID) LEFT JOIN PQE ON Course.PQEID = PQE.ID) LEFT JOIN ResponsibilityCourse ON Course.ID = ResponsibilityCourse.CourseID) LEFT JOIN Responsibility ON ResponsibilityCourse.ResponsibilityID = Responsibility.ID) LEFT JOIN Location ON CourseEvent.CourseLocation = Location.ID) LEFT JOIN RoleCourse ON Course.ID = RoleCourse.CourseID;
SELECT
Course.[ID],
Course.Title,
Course.Outline,
Course.CPD,
Course.Presenter,
Course.Timings,
Course.Compulsory,
CourseEvent.CourseLocation,
CourseEvent.CourseDate,
CourseEvent.CourseTime
FROM
(((((((Course RIGHT JOIN CourseEvent ON Course.[ID] = CourseEvent.CourseID)
LEFT JOIN GroupCourse ON Course.[ID] = GroupCourse.CourseID)
LEFT JOIN [Group] ON GroupCourse.GroupID = Group.[ID])
LEFT JOIN PQE ON Course.PQEID = PQE.[ID])
LEFT JOIN ResponsibilityCourse ON Course.[ID] = ResponsibilityCourse.CourseID)
LEFT JOIN Responsibility ON ResponsibilityCourse.ResponsibilityID = Responsibility.ID)
LEFT JOIN Location ON CourseEvent.CourseLocation = Location.[ID])
LEFT JOIN RoleCourse ON Course.ID = RoleCourse.CourseID)
P | Pld | Pts | |
1 | Liverpool | 16 | 39 |
2 | Chelsea | 17 | 35 |
3 | Arsenal | 17 | 33 |
4 | Nottm F | 17 | 31 |
5 | Bournemouth | 17 | 28 |
6 | Aston Villa | 17 | 28 |
7 | Manchester C | 17 | 27 |
8 | Newcastle | 17 | 26 |
9 | Fulham | 17 | 25 |
10 | Brighton | 17 | 25 |
11 | Tottenham | 17 | 23 |
12 | Brentford | 17 | 23 |
13 | Manchester U | 17 | 22 |
14 | West Ham | 17 | 20 |
15 | Everton | 16 | 16 |
16 | Palace | 17 | 16 |
17 | Leicester | 17 | 14 |
18 | Wolves | 17 | 12 |
19 | Ipswich | 17 | 12 |
20 | Southampton | 17 | 6 |