General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 16th, 2003, 06:07 AM
Johnie Johnie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: North Devon - England
Posts: 20 Johnie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 5 sec
Reputation Power: 0
Syntax error

I'm getting this error message:

SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near '2003-06-01' AND '2003-08-01' ORDER BY i_date ASC' at line 1

In the database i_refid is a VARCHAR and i_date is DATE format.

I'm using ASP with a mySQL database, and the string I'm using is:

SET rsFind = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM Invoicez WHERE i_refid = '" & myref & "' AND i_date BETWEEN '" & begindate & "' AND '" & enddate & "' ORDER BY i_date ASC"
rsFind.Open mySQL, strCon

begindate and enddate is being sent as YYYY-MM-DD or YYYY/MM/DD with the same error message.

Can anyone offer any suggestions?

Johnie

Reply With Quote
  #2  
Old July 16th, 2003, 08:55 AM
Johnie Johnie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: North Devon - England
Posts: 20 Johnie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 5 sec
Reputation Power: 0
Fixed

Forget it, it's fixed.

The link was adding a ' to the myref value.

I can't believe I spent hours on it.

Johnie

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Syntax error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway