Advertisement

06.03.2008 at 10:32PM PDT, ID: 23455654
[x]
Attachment Details

SQL - syntax , Join query

Asked by peterdarazs in SQL Query Syntax, Visual Basic Programming

Hi Experts

I'm trying to find CustomerID's (in VB6) for customers from a specified post code who bought a specified item, and write the ID's into a separate table

Sep_Table:  Columns  = CustID
Cust_Details: Columns = CustID (no duplicates) , PostCode (text)
Cust_Sales: Columns = CustID (has duplicates) , ItemBought (text)

Being a newby, i don't have experience in this level of sql , but imagine it would be structured something like this. Need help with the full syntax though.

Dim CLIENTS as Recordset

**help here please**
' 'For each Cust_Details.ID  
' 'If Cust_Details.PostCode  = "SpecifiedPostCode" AND Cust_Sales.Item = "SpecifiedItem"
' 'then insert PatID into Sep_Table

Set CLIENTS = CURDB.OpenRecordset(SQL, dbOpenSnapshot)
    DoEvents

Many thanks

Peter
Start Free Trial
[+][-]06.03.2008 at 11:18PM PDT, ID: 21707350

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.03.2008 at 11:59PM PDT, ID: 21707537

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 04:14AM PDT, ID: 21708794

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 04:31AM PDT, ID: 21708907

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 04:31AM PDT, ID: 21708910

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 04:38AM PDT, ID: 21708951

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 05:25AM PDT, ID: 21709266

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Visual Basic Programming
Sign Up Now!
Solution Provided By: davidsperling
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628