Hi all,
I'm trying to do something very simple but I'm having a major brain freeze. I have two access tables and I'm trying to read data from both and display the information. My primary key in both tables is personid. My first table(obits) I want to get firstname, lastname, personid, dateofdeath. The second table(Guestbook) I want to get personid, condolences.
My query:
<cfquery datasource="#DSN#" name="getobit">
SELECT Obits.Personid,
Obits.FirstName,
Obits.MiddleName,
Obits.LastName,
Obits.DateOfDeath,
Guestbook.personid,
Guestbook.condolences
FROM Obits, Guestbook
</cfquery>
Now everytime I run it I get the data coming back like this:
Frederking, Howard W. 02/25/2007 This is a test.
Smith, Amanda 02/02/2007 This is a test.
Frederking, Howard W. 02/25/2007 sflalsdjf;ajsfdjlasjdflajsf dlasdjflajsdfkjlasjflkjsafljd sfsa
Smith, Amanda 02/02/2007 jdsflalsdjf;ajsfdjlasjdflajsf dlasdjflajsdfkjlasjflkjsafljd sfsa
Frederking, Howard W. 02/25/2007 gfhdfghdfhfdgh
Smith, Amanda 02/02/2007 gfhdfghdfhfdgh
Frederking, Howard W. 02/25/2007 sadfasf
Smith, Amanda 02/02/2007 sadfasf
It's putting my data in a mess. I don't think I'm joining the tables correctly in my query. When I display it I only want the person's name and date of death to show once and all the condolences for that person to show. The name is repeating for each condolences and for some reason some of the condolences are not with the appropiate name.
Any help would be appreciated.
Thanks,
Kelly
I'm trying to do something very simple but I'm having a major brain freeze. I have two access tables and I'm trying to read data from both and display the information. My primary key in both tables is personid. My first table(obits) I want to get firstname, lastname, personid, dateofdeath. The second table(Guestbook) I want to get personid, condolences.
My query:
<cfquery datasource="#DSN#" name="getobit">
SELECT Obits.Personid,
Obits.FirstName,
Obits.MiddleName,
Obits.LastName,
Obits.DateOfDeath,
Guestbook.personid,
Guestbook.condolences
FROM Obits, Guestbook
</cfquery>
Now everytime I run it I get the data coming back like this:
Frederking, Howard W. 02/25/2007 This is a test.
Smith, Amanda 02/02/2007 This is a test.
Frederking, Howard W. 02/25/2007 sflalsdjf;ajsfdjlasjdflajsf dlasdjflajsdfkjlasjflkjsafljd sfsa
Smith, Amanda 02/02/2007 jdsflalsdjf;ajsfdjlasjdflajsf dlasdjflajsdfkjlasjflkjsafljd sfsa
Frederking, Howard W. 02/25/2007 gfhdfghdfhfdgh
Smith, Amanda 02/02/2007 gfhdfghdfhfdgh
Frederking, Howard W. 02/25/2007 sadfasf
Smith, Amanda 02/02/2007 sadfasf
It's putting my data in a mess. I don't think I'm joining the tables correctly in my query. When I display it I only want the person's name and date of death to show once and all the condolences for that person to show. The name is repeating for each condolences and for some reason some of the condolences are not with the appropiate name.
Any help would be appreciated.
Thanks,
Kelly