SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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 4th, 2004, 06:20 PM
kokopoko kokopoko is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 kokopoko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
getting records by date

I've got some code that is driving me nuts.

strSQL="SELECT comments6 FROM modissurvey WHERE datevalue >= " & strStartDate &"AND datevalue <= " & strStopDate

This is not working as it returns 0 records when it shouldn't. My strStartDate is in the form 2/1/2004. The datevalue field in the table is in the form 2/1/2004. I cannot figure out why this sql is not working.

Can anyone shed some light?

Reply With Quote
  #2  
Old March 4th, 2004, 06:22 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
What database?

Reply With Quote
  #3  
Old March 6th, 2004, 08:11 PM
HWDave HWDave is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Long Beach, CA
Posts: 54 HWDave User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 52 sec
Reputation Power: 5
I would start by returning all datevalues. Make sure it is in the correct format. Also, I don't know if you copied your code exactly as it appears in your work, but the [ "AND ] may need a space that is causing your SQL to kludge (Probably not that). . .

The way we are accessing our DB we have to include a timestamp as well as a datestamp, perhaps try adding 00:00:01 to the end of your date field?

Reply With Quote
  #4  
Old March 8th, 2004, 11:13 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Back to Memnoch question, Which Database.

Different Db use different Syntax for Date, yours is probably incorrect.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > getting records by date


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 2 hosted by Hostway
Stay green...Green IT