I have created a database for my company to track a various amount of things. I am now struggling to produce a Mailing list for sending out letters to our clients.
A simplified version of my clients table looks like this:
Clients Table
ClientID HouseholdID Prefix First Name Last Name Gender Relationship Address
1 1 Mr. John Doe Male Spouse 12 way ln
2 1 Mrs. Jane Doe Female Spouse 12 way ln
3 2 Dr. Jake blah Male Single 23 way ln
4 3 Mr. Rick one Male Spouse 34 way ln
5 3 Mrs. Justine two Female Spouse 34 way ln
I want my result to look like this:
HouseholdID Prefix1 First Name1 Last Name1 Prefix2 First Name2 Last Name2 Address
1 Mr. John Doe Mrs. Jane Doe 12 way ln
2 Dr. Jake Blah 23 way ln
3 Mr. Rick one Mrs. Justine Two 34 way ln
From here I am able to create another query with if statements that can finish the label to look like:
Mr & Mrs. John Doe Dr. Jake Blah Mr. Rick One & Mrs. Justine Two
12 way ln 23 way ln 34 way ln
I recently came across cross tab queries which i eventually used to track client meetings but for this I don't know how to handle the multiple columns and text values. Can someone point me in the right direction. Maybe a crosstab query isn’t the right way to do this. I am a beginner in SQL
Any help is greatly appreciated!
A simplified version of my clients table looks like this:
Clients Table
ClientID HouseholdID Prefix First Name Last Name Gender Relationship Address
1 1 Mr. John Doe Male Spouse 12 way ln
2 1 Mrs. Jane Doe Female Spouse 12 way ln
3 2 Dr. Jake blah Male Single 23 way ln
4 3 Mr. Rick one Male Spouse 34 way ln
5 3 Mrs. Justine two Female Spouse 34 way ln
I want my result to look like this:
HouseholdID Prefix1 First Name1 Last Name1 Prefix2 First Name2 Last Name2 Address
1 Mr. John Doe Mrs. Jane Doe 12 way ln
2 Dr. Jake Blah 23 way ln
3 Mr. Rick one Mrs. Justine Two 34 way ln
From here I am able to create another query with if statements that can finish the label to look like:
Mr & Mrs. John Doe Dr. Jake Blah Mr. Rick One & Mrs. Justine Two
12 way ln 23 way ln 34 way ln
I recently came across cross tab queries which i eventually used to track client meetings but for this I don't know how to handle the multiple columns and text values. Can someone point me in the right direction. Maybe a crosstab query isn’t the right way to do this. I am a beginner in SQL
Any help is greatly appreciated!