How does this work? SELECT NewMessage.NewMessageId, NewMessage.NewMessageText, PU2.FirstName + ' ' PU2.LastName as 'messageFrom', PU.FirstName + ' ' PU.LastName as 'messagesentTo', NewMessage.MessageDate, NewMessage.MessageStatus FROM NewMessage join PlumUser PU on PU.UserID = NewMessage.MessageSentTo join PlumUser PU2 on PU2.UserID = NewMessage.MessageFrom
-----Original Message----- From: Mark Fuqua [mailto:[EMAIL PROTECTED] Sent: Thursday, July 28, 2005 12:36 PM To: [email protected] Subject: [plum] Custom Query for Two Plum Users Good afternoon, I have a table called NewMessages which has two references to the Plum Users table. I have been trying to write a query (at this point anyway) to just return what is in the NewMessage table. What follows doen't work. Any idea what will? SELECT NewMessage.NewMessageId, NewMessage.NewMessageText, NewMessage.MessageFrom, NewMessage.MessageSentTo, NewMessage.MessageDate, NewMessage.MessageStatus FROM PlumUser AS PlumUser1, PlumUser INNER JOIN NewMessage ON (PlumUser.UserID = NewMessage.MessageSentTo) AND (PlumUser.UserID = NewMessage.MessageFrom); Actually, I would like to have the FirstName and LastName AS Name for both references as well. But thought I should try and get it to work with just ID first. But since I am obviously stumped with the easy one and have to ask anyway, I thought... "why not go for all the marbles?" Thanks, Mark ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm ********************************************************************** ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm **********************************************************************
