Guest XavierX Posted September 5, 2006 Share Posted September 5, 2006 Hi,I am trying to create a web page that outputs a list of data from a join on 2 tables.The Tables:PANEL - A list of possible panel numbersPANELID - Primary key, EVENTS - List of events that occur EVENTID - Unique autonumber for each eventPANELID - posted from PANEL tableEVENTCODE - what type of event it isADATE - Date and Time the event was posted.What I am trying to achieve:I need to create a list of ALL panel IDs, regardless of whether they have any entries in the EVENTS table, but when they do, to display the max(ADATE) and event code - i.e. the last known date. If there are no events, the fields for ADATE and EVENTID should be blank.What I have:I am using the following query: SELECT DISTINCT (PANELID) AS UPANELID, Max(EVENTS.ADATE) AS LASTCONTACT, EVENTS.EVENTIDFROM PANEL LEFT JOIN EVENTSON PANEL.PANELID = EVENTS.PANELIDGROUP BY EVENTS.EVENTID, PANEL.PANELID; The result is something like: UPANELID LASTCONTACT EVENTID10001 04/09/2006 14:55:56 55510003 10007 04/09/2006 09:41:21 55510008 04/09/2006 09:44:47 55510012 10014 04/09/2006 14:43:37 55510015 10016 10017 Now this works perfectly in the query tab of MS Access. But when I try and use it in my .asp page using the ADODB object, I get an unspecified server error.I know it is the query that is the problem, because if I swap it for a simpler normal join, with out the LEFT, it works fine.Can anyone shed any light on why it would not work or if there is part of the query that is not compatible with ADODB?Many thanks Link to comment Share on other sites More sharing options...
aspnetguy Posted September 5, 2006 Share Posted September 5, 2006 post the ASP code you use to make the query and execute it. It is probably a simple syntax error. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now