Jump to content

Query not going right


ErocM

Recommended Posts

I have 3 tables that I am trying to query. 

Members - has user info to include  (UserId, Username)
MessageInfo -has (MessagetId, MessageFrom, MessageTo)
MessageText - (MessageId, PostText)

I want to query these together together and I'm not sure how to tie the 3 together. I can quest each individually but I'm having no success getting a query that incorporates them all. 

Anyone have any suggestions?

Thanks,
E
Link to comment
Share on other sites

You need to redesign the table so they have a common link

Members = fields Userid, username ect...
MessageInfo = fields MessageID, [b]Userid[/b], MessageFrom, MessageTo ect...
MessageText = MessageID, PostText ect...

By adding the Userid in the message info table you can now link like so:

Members.Userid = MessageInfo.Userid AND MessageInfo.MessageId = MessageText.MessageId

Hope that helps

Ray
Link to comment
Share on other sites

Sorry if it doesn't make sense I can do this on MSAccess since I'm more familiar with it, so I apologize if I sound ignorant on this...

[b]Members = fields: Userid, username ect...
MessageInfo = fields: MessageID, Userid, MessageFrom, MessageTo ect...
MessageText = fields: MessageID, PostText ect...[/b]

Anyhow couldn't this be done:

- take the MessageInfo, which has the same field "[b]MessageID[/b]", link to MessageText's "[b]MessageId[/b]" to get the "[b]PostText[/b]"
- then link the MessageInfo's "[b]UserId[/b]" to the Members' "[b]UserId[/b]" to get the "[b]Username[/b]" for the "[b]MessageFrom[/b]" and "[b]MessageTo[/b]" ?

that being said and if it can be done, can anyone help me figure out how to do it?

Thanks,
E
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.