Results 1 to 2 of 2

Thread: SQL Statement with Two Tables

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Angry

    Hello

    Tools:
    Crystal Reports 4.6, VB 6.0 and Access 97

    Table Name:
    Expense
    Times

    Here is my sql statement for one table

    db.Execute "SELECT * INTO Expense IN '" & strTempDb & "' FROM Expense " & _
    "WHERE StartDate >= #" & Format(datDate3, "mm/dd/yyyy") & "# " & _
    "AND EndDate <= #" & Format(datDate4, "mm/dd/yyyy") & "#"

    Here I am querying records for those two dates that are entered... This is one table... I want to be able to add a second table to this statement.... where I am using different text boxes instead

    The dates from each table are related.. I am trying to place the results into a TEMP.mdb and then my crystal report displays the data from that temp.mdb

    Can anyone help me with my statement to search from two tables in the same db????



    How can I add a third criteria to this statement

    db.Execute "SELECT * INTO Times IN '" & strTempDb & "' FROM Times WHERE DatePerformed>=#" & Format(datDate3.Value, "dd/mm/yyyy") & "# AND DatePerformed<=#" & Format(datDate4.Value, "dd/mm/yyyy") & "#"


    I want to add the field (ProjectCode) and the control )DataCombo1.text


    Help is greatly appreciated!!!!

    Steve

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Posts
    138
    1. Can't you use two separate statments to obtain the first goal?
    2. Can't you use another AND/OR criterion and, if necessary, a pair of parentheses to add a third?
    3. If you don't need to preserve the temporary database you need not build it. Just use recordsets.

    [Edited by xmin on 11-12-2000 at 12:30 AM]

Posting Permissions

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



Click Here to Expand Forum to Full Width