<sigh> Yes, as is my habit, I guess...the minute I give up and ask...I get
the answer. So, ahem...thanks, but I have it working with this function. So
unless anyone sees this as being a really stupid string...it should work and
then I guess I just cycle through and add the Sale=True info to each until
EOF, eh?
Function funcBuildQString(CustID, varArray)
varQString= "SELECT * FROM Referrals WHERE Referrals.CustID=" & CustID & _
" AND Referrals.TellerID="
varBound=UBound(varArray)
For i=0 to varBound
If i <> varBound Then
varQString=varQString & varArray(i) & " OR Referrals.TellerID="
Else
varQString=varQString & varArray(i)
End If
Next i
funcBuildQString=varQString
End Function
The result =
SELECT * FROM Referrals WHERE Referrals.CustID=ThisCustomer AND
Referrals.TellerID="T44" OR Referrals.TellerID="T56"
Dian ~
-----Original Message-----
From: Dian D. Chapman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 08, 2004 9:02 PM
To: Group - ASP
Subject: [ASP] Help with a weird query?
Hi folks…
I'm working on a Word form with ADO/DB connectivity. I'm not too bad with
these, but this one has a slightly complex listbox and I could use some help
trying to figure out how to get one of the processes sorted out. (Hope I can
explain what I need…)
It's a banking form and Access DB w/3 tables…Teller, Referral, Customer…the
Referral table has both the CustomerID and TellerID to act as the JOIN table
(????). Whatever it's called, it works. It'll be used to track teller
referrals to customers that end in sales. When a customer's name is checked,
a listbox displays all the referrals for this customer by Referral.Product,
Teller.TellerID, and Referral.Date.
I'm currently working on figuring out how to properly get the TellerID out
of the correct column and now have it displaying in a msgbox…so I think that
parts okay. But now I'm not sure how to get the next part of the query.
Say I end up with TellerID = 444 and TellerID = 555, meaning that both of
these tellers told some customer about checking and now they purchased that
service, so both 444 and 555 should get credit for the sale.
How do I update both these records. Am I missing something and this is so
obvious that I don't see it? Do I query for Referral.TellerID = 444 OR
Referral.TellerID = 555 to get them both into a record set and just loop
through each record to update the Referral.Sale=True and
Referral.SaleDate=Now() fields?
Maybe I'm just been awake too long, but I just can't wrap my brain around
how I can pull more than one TellerID and then update a field or two in both
with the same info? I'm thinking I should to a Do Until RS.EOF and then add
the info into the fields for each record??? Is that all it is.
Any info would be greatly appreciated.
Dian ~
--
This email scanned and certified clean by AVG!
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.7 - Release Date: 12/7/2004
[Non-text portions of this message have been removed]
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.7 - Release Date: 12/7/2004
--
This email scanned and certified clean by AVG!
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.7 - Release Date: 12/7/2004
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/