Database Query

Results 1 to 2 of 2

Thread: Database Query

  1. #1
    Join Date
    Dec 1969

    Default Database Query

    I have a record that is touched by several reps and the information is stored by contact attempt so that rep A could have touched the record at anytime and it stored as rep1-rep10 depending on how many times the record has been opened. Now I&#039;m wanting to write a query to pull the rep ID from every one of the rep attemps to see how many they have opened and successfully handled.<BR><BR>Select all records where rep1, rep2, rep3, rep4, rep5, rep6, rep,7 ,rep8, rep9, rep10 is equal to "xxx"<BR><BR>rep1 - rep10 designate the columns I want to search...<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default I know you probably don't want to

    hear this, however this would have been much easier if you had a separate table with a separate record for EACH attempt.<BR><BR>That way all you would have to do is<BR><BR>SELECT * FROM repcontacttable where repid=&#039;xxx&#039;<BR><BR>Also, if you put a datetime stamp in there you could also report on certain date/times that specific reps "touched" that record. And you limit yourself to ten reps the way you have it.<BR><BR>If you have to do it with your table, I think your are forced with listing each repid field in your WHERE:<BR><BR>SELECT * FROM repcontacttable where repid1=&#039;xxx&#039; OR repid2=&#039;xxx&#039; OR repid3=&#039;xxx&#039; etc........<BR><BR>Not pretty or functional. ; )

Posting Permissions

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