Jump to content

Archived

This topic is now archived and is closed to further replies.

nmathews

Relationships with SQL

Recommended Posts

I'm making a results page for a organization with members names and email address on my website. The thing is, not every member has an email address. The secertary only enters the email address in of the member and uploads in though Access 97. I have set up an extra table that would include the fallowing fields: ID, Firstname, Lastname, email. The code that I came up with is:

 

SELECT emails.*, members.*

FROM emails INNER JOIN members ON emails.ID = members.ID

ORDER BY members.lastname ASC

 

This works, but it only pulls up members with email addresses in both tables. How do I make it so that if the address does not exsit, it just leaves the field blank on the report, but still shows the members name

Share this post


Link to post
Share on other sites

Not sure if this will work but it is worth a try...just switch everything...

 

You had:

SELECT emails.*, members.*

FROM emails INNER JOIN members ON emails.ID = members.ID

ORDER BY members.lastname ASC

 

Try:

SELECT members.*, emails.*

FROM members INNER JOIN emails ON members.ID = email.ID

ORDER BY members.lastname ASC

 

that might possibly do the trick...

 

Let me know the outcome

 

BS ;)

Share this post


Link to post
Share on other sites

×

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.