SQL Query Help

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

RogueSpear00

Thread Starter
Joined
Jan 18, 2008
Messages
472
I wasn't sure whether to put this in Software or here, so I figured I'd start here :) I know this will be a straightforward answer from you SQL geniuses...

I have a table, it contains contacts that I import on a daily basis. I will have an ASP.NET front end for user interaction. From this table, my intention is to send them all mailers - but only one to each address. So my end result is a user enters a date (which corresponds to teh date imported) and they are given a resultant grid that has all the unique addresses associated to that date. I only want to send a mailer to that address once - many times my original imported list will contain multiple businesses at the same address.

Table: ContactTable
Fielsd:
ID, CompanyName, Address, City, State, Zip, Phone

I can use the SELECT DISTINCT clause, but I need all the data associated to it (company name, etc.)

I have over 262000 Records in this table.

If I select a sample date of 1/10/2011, I get 2401 records. SELECT DISTINCT Address from the same date gives me 2092 records. This is workable, I would send those 2092 people a mailer.

Secondly, I'd have to be able to historically check if a mailer was already sent to that address as well. I would not want to send another mailer to the same business tomorrow either.

What's my best way?
 

RogueSpear00

Thread Starter
Joined
Jan 18, 2008
Messages
472
Bleh, Moderator can you move this to Software Development please... I should have put it in there in the first place....
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top