Advertisement

05.15.2008 at 05:09AM PDT, ID: 23404727
[x]
Attachment Details

SQL: syntax assistance please

Asked by peterdarazs in SQL Query Syntax

Hi Experts - some help please with SQL syntax to select records for a new table.

In broken code :   If IsDate TABLE1 [_Date] and TABLE1 [_Reason] contains string "XYZ"
                             then insert TABLE1 [_KeyNr and _Date] into TABLE2 [_KeyNr and _Date]

I got stuck about here:

    SQL = ""
    SQL = "Insert into TABLE2 ( _KeyNr, _Date )"
    SQL = SQL & " select TABLE1.KeyNr, TABLE1.Date "
    SQL = SQL & "when ???? IsDateTABLE1.date  and ?????Instr TABLE1.Reason  =  "XYZ"
    CURDB.Execute SQL
    DoEvents
    Screen.MousePointer = 0
    On Error GoTo 0

Complete code please.
Many thanks

PeterStart Free Trial
 
Loading Advertisement...
 
[+][-]05.15.2008 at 05:16AM PDT, ID: 21572620

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.

 
[+][-]05.15.2008 at 05:24AM PDT, ID: 21572679

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

Zone: SQL Query Syntax
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.15.2008 at 05:27AM PDT, ID: 21572715

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.

 
[+][-]05.15.2008 at 06:25AM PDT, ID: 21573307

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.

 
[+][-]05.15.2008 at 10:07AM PDT, ID: 21575897

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.

 
[+][-]05.15.2008 at 09:19PM PDT, ID: 21579967

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.

 
[+][-]05.15.2008 at 11:52PM PDT, ID: 21580482

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628