Results 1 to 4 of 4

Thread: SQL statement

  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: SQL statement

    Hi All,
    My DB is Access.I'm trying to pull data from access database into an XML file.I'm able to pull the data.But when I try to apply WHERE clause in my sql statement,it doesn't work and is giving me the syntax error.
    Here is my SQL statement,

    .Source = "SELECT * FROM ([GrantNet],[Categories]) " & _
    "WHERE GrantNet.Issue_Number= 01-11"

    I'm not sure what mistake I'm doing.Any help is appreciated a lot.Thanks,
    Fun

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    most likely you need single quotes around the issue number, because what your query now looks for is issue numbers equal to -10, because 01 minus 11 is -10

    also, it looks like you're getting a cross join of two tables, is that what you really want?

    rudy
    http://r937.com/

  3. #3
    Join Date
    Nov 2003
    Posts
    2
    Hi,
    Thanks for the reply.But I tried putting single quotes around 'Issue_Number' .It generrates only the schema and does not generate the XML file at all.
    Any suggestions??
    Regards,
    Fun

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry for delay in replying, AFK for a week or so

    no, put the quotes around 01-11

    as for XML, sorry, can't help, wrong language

Posting Permissions

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