1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Making SQL Search an Excel Spreadsheet

Discussion in 'Other PC Software' started by CUISTech, 2011/08/30.

  1. 2011/08/30
    CUISTech

    CUISTech Inactive Thread Starter

    Joined:
    2008/10/28
    Messages:
    419
    Likes Received:
    1
    We send out e-mails and text messages to people who do business with us. Sometimes these bounce back as invalid, because we've been given the wrong information, or because there's a spelling error, or someone switched mobile providers.

    We had someone write a pair of SQL queries to pull these one at a time. For example, we get an e-mail back saying "123-456-7890 is an invalid number. "

    We can plug that phone number into the query and return our member's name and account information (which includes his address, so we can send a letter saying, "you're not receiving our mails, please contact us so you can get these notices "), but it only returns one result at a time.

    Now, we can expand a WHERE statement (which gets us one result each time we put a specific number in the statement itself: "WHERE DefaultSMSNumber = '1234567980' ") as many times down the line as we want, and continue getting results. That's tedious.

    Right now, I'm taking the bounced phone number or e-mail from each returned e-mail and putting them into an excel spreadsheet. Column A is phone numbers that bounced, and column B is e-mails that bounced.

    I don't know how to write SQL queries, so I'll just describe the behavior I'm looking for, to see if anyone can make sense of it...

    -SQL reads line 1 of spreadsheet
    -SQL sees phone number 1234567890
    -SQL sees e-mail empty field
    -SQL pulls customer record for 1234567890 and puts phone number, e-mail, customer name, customer address in results window
    -(all those things are in our database to be pulled, so we don't have to define anything new)
    -SQL reads line 2 of spreadsheet
    -etc.
    -SQL exports the list of results to a text file OR it fills the empty member name and address fields right into the spreadsheet

    I don't know all the capabilities of SQL or what kinds of add-ons there are, but I'm hoping there's something that has this capability to do this en masse, rather than picking at these e-mails one at a time.

    (After we get the customer's account, address and name into a file, we have another vendor-specific program that will generate a form letter with that information saying "your phone isn't getting our notices! ")
     
  2. 2011/08/30
    Admin.

    Admin. Administrator Administrator Staff

    Joined:
    2001/12/30
    Messages:
    6,687
    Likes Received:
    107
    Moved to appropriate forum.
     

  3. to hide this advert.

  4. 2011/08/30
    rsinfo

    rsinfo SuperGeek Alumni

    Joined:
    2005/12/25
    Messages:
    4,076
    Likes Received:
    178
    If you can pull your excel sheet to SQL table, then I believe your problem could be solved.

    If we call the new excel data table as Problems & your exisiting member table as members then :

    SELECT * from members,problems where problems.DefaultSMSNumber == members.DefaultSMSNumber

    You can replace '*' with fields that you would like the query to get.
     
  5. 2011/09/04
    rsinfo

    rsinfo SuperGeek Alumni

    Joined:
    2005/12/25
    Messages:
    4,076
    Likes Received:
    178
    Any updates ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.