Results 1 to 3 of 3

Thread: Syntax problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430

    Syntax problem

    On the second WHERE the data must be greater then "0". Can't get the systax right.

    strQuery = "SELECT * FROM Pizzo "
    strQuery = strQuery & "WHERE DateofDay BETWEEN "
    strQuery = strQuery & "#" & varStart & "# And #" & varEnd & "#" and WHERE (Chiller1Amps <> 0) "
    strQuery = strQuery & "ORDER BY DateofDay, TimeofDay ASC "

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    You only need the keyword "WHERE" at the beginning of your where clause:

    VB Code:
    1. strQuery = "SELECT * FROM Pizzo " & _
    2.                      "WHERE DateofDay BETWEEN ("  & _
    3.                      "#" & varStart & "# And #" & varEnd & "#)" & _
    4.                      " AND Chiller1Amps > 0 " & _
    5.                      "ORDER BY DateofDay, TimeofDay ASC "
    Wydok

    "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."

    -John Von Neumann ca. 1949

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    430
    OK Thannks I'll try it.

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