If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-05-03, 11:42
fun fun is offline
Registered User
 
Join Date: Nov 2003
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 11-05-03, 21:01
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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/
Reply With Quote
  #3 (permalink)  
Old 11-07-03, 09:31
fun fun is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 11-16-03, 19:40
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On