ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 30th, 2000, 06:49 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Date Problems

<i><b>Originally posted by : Kevin (kevinb@terranovamedia.com)</b></i><br />Hi there,<br />I am just starting out and have come accross an error which I know is something small but I can't figure it out.<br />I have a form with two inout boxes.One for date and one for email.<br />When they boxes have been filled I do a look up on my Access Db and try to return the records based on email and date.<br />However I just seem to get a Syntax Error when I submit the form....<br />Here is the SQL <br><br /><% <br><br /> email1=Request.Form("btext")<br><br /> conndate = CDate(Request.Form("bdate"))<br><br /> %><br><br /> <br /> <%<br><br /> Set maConn=Server.CreateObject("ADODB.Connection")<br><br /> Set maRecs=Server.CreateObject("ADODB.Recordset")<br /> <br><br /> maConn.Open "track"<br><br /><br />SQL = "SELECT email,"<br><br />SQL = SQL& "name,aucdate,Qty,Price,desc "<br><br />SQL = SQL& "FROM ITEMS WHERE email = '" & Request.Form("btext") & "' " <br><br />SQL = SQL& "AND aucdate = " & #conndate# & " "<br><br /><br />maRecs.Open SQL,maConn<br><br /><br />If maRecs.EOF then<br><br /><br />Response.Write "No data found for today"<br><br /><br />else<br /><br><br />%><br><br /><br />Can anyone help me out please<br />as I keep getting a syntax error for conndate...<br />Thanks a lot <br />Kev<br /><br />

Reply With Quote
  #2  
Old March 31st, 2000, 01:55 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Chris Snider (csnider@worldnet.att.net)</b></i><br />Kevin,<br /><br />Switch you date to a string like this:<br />AND aucdate='" & conndate & "'"<br /><br />Even though it is a Date field, the ADO engine treats it like a string. Also, you will need to test your specific case, but I only get good results when I use DateField >='" & varDate & "'", but I run queries against SQL Server and not so much Access any more.<br /><br />If you have further questions or need more explanation, please email me.<br /><br />Chris Snider<br /><br /><br />------------<br />Kevin at 3/30/2000 4:49:06 AM<br /><br />Hi there,<br />I am just starting out and have come accross an error which I know is something small but I can't figure it out.<br />I have a form with two inout boxes.One for date and one for email.<br />When they boxes have been filled I do a look up on my Access Db and try to return the records based on email and date.<br />However I just seem to get a Syntax Error when I submit the form....<br />Here is the SQL <br><br /><% <br><br /> email1=Request.Form("btext")<br><br /> conndate = CDate(Request.Form("bdate"))<br><br /> %><br><br /> <br /> <%<br><br /> Set maConn=Server.CreateObject("ADODB.Connection")<br><br /> Set maRecs=Server.CreateObject("ADODB.Recordset")<br /> <br><br /> maConn.Open "track"<br><br /><br />SQL = "SELECT email,"<br><br />SQL = SQL& "name,aucdate,Qty,Price,desc "<br><br />SQL = SQL& "FROM ITEMS WHERE email = '" & Request.Form("btext") & "' " <br><br />SQL = SQL& "AND aucdate = " & #conndate# & " "<br><br /><br />maRecs.Open SQL,maConn<br><br /><br />If maRecs.EOF then<br><br /><br />Response.Write "No data found for today"<br><br /><br />else<br /><br><br />%><br><br /><br />Can anyone help me out please<br />as I keep getting a syntax error for conndate...<br />Thanks a lot <br />Kev<br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Date Problems


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 1 hosted by Hostway