Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me debug my query...

Status
Not open for further replies.

SkydivingSteve

Technical User
Feb 20, 2004
27
GB

The following query

[tt]SELECT CoursesIndividuals.ID, CoursesIndividuals.FirstName, CoursesIndividuals.LastName, Courses.Date, CoursesIndividuals.CourseName, CoursesIndividuals.Attendee, Courses.Venue, CoursesIndividuals.StartTime
FROM CoursesIndividuals, Courses
WHERE (((CoursesIndividuals.Attendee)=[Forms]![ReportsSwitchboard]![List34]) AND (Not (Courses.Venue) Is Null) AND ((CoursesIndividuals.StartTime)<#12/30/1899 16:0:0#) AND ((CoursesIndividuals.CourseID)=[Courses].[ID]))
ORDER BY Courses.Date DESC;[/tt]

is not ordering by date... maybe it's something to do with the fact that both tables in the join have a date field?

Please help in order to save my fading sanity.

Steve
In the Jungle of the senses
 
Are you sure Courses.Date is of data type 'Date' (and not Text saved with a date format?)

Ignorance of certain subjects is a great part of wisdom
 
Perhaps this ?
SELECT I.ID, I.FirstName, I.LastName, C.Date, I.CourseName, I.Attendee, C.Venue, I.StartTime
FROM CoursesIndividuals AS I INNER Courses AS C ON I.CourseID = C.ID
WHERE I.Attendee=[Forms]![ReportsSwitchboard]![List34] AND Not (C.Venue Is Null) AND I.StartTime<#12/30/1899 16:0:0#
ORDER BY CVDate(C.Date) DESC

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top