[mso] AccessSQL
- From: "Glenda Wells" <gwells@xxxxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Mon, 18 Jul 2005 11:46:52 -0400
I'm still feeling my way around writing SQL queries in reports and
appreciating all ya'll helping.
I have telephone and email in the same table
I'd like to extract the most recent email by commID (this would be the
maximum record) and the Active telephone of which there can only be one.
I THINK this needs a query/subquery with a join to get the max email as
well as another subquery to get the active phone.
Here's what the table looks like
tblCOMM
UID commID type active comm
A001 1001 em gwells@xxxxxxxxxxx
A001 1002 em gwells@xxxxxxx
A001 1003 em gwells@xxxxxxx
A001 1004 ph -1 386-822-7088
A001 1005 ph 386-822-7126
My desired result is
UID, email, phone
A001, gwells@xxxxxxx, 386-822-7088
I have this which (I hope) gets me the email address but how do I get
phone number too?
SELECT tblCOMM.UID, tblCOMM.comm
FROM tblCOMM
WHERE (((tblCOMM.UID)=3D(SELECT
max(b.commID) FROM tblCOMM b WHERE b.UID =3D tblCOMM.UID)) AND
((tblCOMM.type)=3D"em"));
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
- Follow-Ups:
- [mso] Re: AccessSQL
- From: Jim Pettit
Other related posts:
- » [mso] AccessSQL
- » [mso] Re: AccessSQL
- » [mso] Re: AccessSQL
- » [mso] Re: AccessSQL
- » [mso] Re: AccessSQL
- » [mso] Re: AccessSQL
- [mso] Re: AccessSQL
- From: Jim Pettit