I have a query to pull fields to create envelopes so it has name, address, etc. I did this as a select distinct to make sure I only got one envelope per person. Now my users want to be able to apply some criteria to the list, example past due. When I added the criteria fields, it messed up my distinct since the due date is different for each record.
Example that used to give me one envelope per name/address combination:
Select distinct name, address from mytable;
New example that essentially gives me one envelope for every record:
Select distinct name, address, duedate from mytable where date > duedate;
I orginally tried:
Select distinct name, address from my table where date > duedate;
but all the fields in the where need to be part of the select clause.
I'm having a bear of a time figuring out how to form this query and I've probably worked myself up enough that I'm making it way more difficult that it needs to be.
Thanks
Lution
Example that used to give me one envelope per name/address combination:
Select distinct name, address from mytable;
New example that essentially gives me one envelope for every record:
Select distinct name, address, duedate from mytable where date > duedate;
I orginally tried:
Select distinct name, address from my table where date > duedate;
but all the fields in the where need to be part of the select clause.
I'm having a bear of a time figuring out how to form this query and I've probably worked myself up enough that I'm making it way more difficult that it needs to be.
Thanks
Lution