Counting enquires sent to partner.

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Counting enquires sent to partner.

    Hello,



    I am trying to design an ASP system which will submit the contents of a
    feedback form to a partner, based on a daily maximum number of feedback
    forms per day. For example, if partner1 whishes to receive no more than 5
    feedback forms per day, then I want the system to check how many forms it
    has submitted to partner1 in previous 24 hours and then act accordingly. If
    the number has reached the partner maximum, I want it to submit to the next
    partner and so on. So, if I have 5 partners each taking 5 forms per day, I
    want the system to automatically distribute 5 emails per partner based on 25
    feedback forms received in 24 hours.



    Any ideas? Here is how I see it working (not real code):



    DEFINE PARTNER RECIPIENT:

    [email]PARTNER1@DOMAIN.COM[/email]

    [email]PARTNER2@DOMAIN.COM[/email]

    [email]PARTNER3@DOMAIN.COM[/email]



    DEFINE NUMBER OF ENQUIRIES PER 24 HOURS:

    PARTNER1: 5 enquiries per 24hrs

    PARTNER2: 10 enquiries per 24hrs

    PARTNER3: 2 enquiries per 24hrs


    > USER SUBMIT FORM


    If Partner1 Number of Enquiries in last 24 hours <= 5 then submit to
    Partner1

    Else if Partner2 Number of Enquiries in last 24 hours <= 10 then
    submit to Partner2

    Else if Partner3 Number of Enquiries in last 24
    hours <= 2 then submit to Partner3

    ELSE

    Submit to overflow partner



    Any ideas or tips greatly appreciated. It's the counting of feedback forms
    in last 24hrs which is confusing me! I am thinking about inserting each
    feedback form to a database with a timestamp, and then having a file read
    the table when the submit page loads, check how many leads have gone to
    partnerx where time stamp BETWEEN xx/xx/xxxx AND xx/xx/xxxx.



    Thanks for any tips!



    Gary.



    Darren Guest

  2. Similar Questions and Discussions

    1. Enquires about OledbDataAdapter
      Hi all, I am using oledbDataAdapter to bind the data into datagrid, as i only knows how to use datareader,i have some doubts in oledbDataAdapter....
    2. Sorting by conversation-partner
      Hi all, I don't know wether this is the right newsgroup, its actually a sql-problem. I want to make an online mail-service. One of the...
    3. Sort by conversation-partner
      Hi all, I don't know wether this is the right newsgroup, its actually a sql-problem. I want to make an online mail-service. One of the...
    4. Counting partner enquiries and setting daily maximum.
      Hello, I am trying to design an ASP system which will submit the contents of a feedback form to a partner, based on a daily maximum number of...
    5. Designer looking to partner with PHP/ MySQL Programmer for various projects.
      I'm a business minded web designer (based in Vancouver, BC) with a few exciting online business ideas. I am looking for a partner who has...
  3. #2

    Default Re: Counting enquires sent to partner.

    Yes, you're on the right track although I would just have a table with the
    PartnerID, SentDate.

    Then in the Partner table you can have a sequence next to each partner, (the
    order to start from at midnight)

    Check the count of referrals for today from the table above and order the
    results by the sequence

    Then after sending an email update the count in the first table.

    Something like this should get you the next partner, but remember to insert
    into tblReferrals after each email is sent.


    SELECT TOP 1 tblPartners.PartnerName, tblPartners.PartnerEmail,
    tblPartners.ReferralSequence
    FROM tblPartners LEFT JOIN tblReferrals ON tblPartners.PartnerID =
    tblReferrals.PartnerID
    WHERE (((tblReferrals.SentDate)=Date()))
    GROUP BY tblPartners.PartnerName, tblPartners.PartnerEmail,
    tblPartners.ReferralSequence
    HAVING (((Count(tblReferrals.ReferralID))<5))
    ORDER BY tblPartners.ReferralSequence;




    "Darren" <d@nospam.com> wrote in message
    news:G_ZQb.9782$ax6.104705158@news-text.cableinet.net...
    > Hello,
    >
    >
    >
    > I am trying to design an ASP system which will submit the contents of a
    > feedback form to a partner, based on a daily maximum number of feedback
    > forms per day. For example, if partner1 whishes to receive no more than 5
    > feedback forms per day, then I want the system to check how many forms it
    > has submitted to partner1 in previous 24 hours and then act accordingly.
    If
    > the number has reached the partner maximum, I want it to submit to the
    next
    > partner and so on. So, if I have 5 partners each taking 5 forms per day,
    I
    > want the system to automatically distribute 5 emails per partner based on
    25
    > feedback forms received in 24 hours.
    >
    >
    >
    > Any ideas? Here is how I see it working (not real code):
    >
    >
    >
    > DEFINE PARTNER RECIPIENT:
    >
    > [email]PARTNER1@DOMAIN.COM[/email]
    >
    > [email]PARTNER2@DOMAIN.COM[/email]
    >
    > [email]PARTNER3@DOMAIN.COM[/email]
    >
    >
    >
    > DEFINE NUMBER OF ENQUIRIES PER 24 HOURS:
    >
    > PARTNER1: 5 enquiries per 24hrs
    >
    > PARTNER2: 10 enquiries per 24hrs
    >
    > PARTNER3: 2 enquiries per 24hrs
    >
    >
    >
    > > USER SUBMIT FORM
    >
    >
    >
    > If Partner1 Number of Enquiries in last 24 hours <= 5 then submit to
    > Partner1
    >
    > Else if Partner2 Number of Enquiries in last 24 hours <= 10
    then
    > submit to Partner2
    >
    > Else if Partner3 Number of Enquiries in last 24
    > hours <= 2 then submit to Partner3
    >
    > ELSE
    >
    > Submit to overflow partner
    >
    >
    >
    > Any ideas or tips greatly appreciated. It's the counting of feedback
    forms
    > in last 24hrs which is confusing me! I am thinking about inserting each
    > feedback form to a database with a timestamp, and then having a file read
    > the table when the submit page loads, check how many leads have gone to
    > partnerx where time stamp BETWEEN xx/xx/xxxx AND xx/xx/xxxx.
    >
    >
    >
    > Thanks for any tips!
    >
    >
    >
    > Gary.
    >
    >
    >

    David Morgan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139