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 November 9th, 2003, 05:50 PM
evanslee evanslee is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: manchester uk
Posts: 3 evanslee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Select nearest match based on date ?

this is what i currently have...
Code:
Dim rs_top40uk
Dim rs_top40uk_numRows

Set rs_top40uk = Server.CreateObject("ADODB.Recordset")
rs_top40uk.ActiveConnection = MM_ConnHeadlines_STRING
rs_top40uk.Source = "SELECT *  FROM UKtop40Charts  WHERE ChartDate Like '%" + Replace(rs_top40uk__MMColParam, "'", "''") + "%' ORDER BY ThisWeek ASC"
rs_top40uk.CursorType = 0
rs_top40uk.CursorLocation = 2
rs_top40uk.LockType = 1
rs_top40uk.Open()

rs_top40uk_numRows = 0

and what im trying to achive is.
user inputs a date via form.
so url would be e.g;
URL
if the choose a non exact date I want it to find all records that match the nearest date. either < Date() or < Now()

I really am stuck on this, . all i can seem to do is get it to display when i input the eact date in the database that makes a match.

Lee

Let me know if any more details will help.

the field in the database is ChartDate and its Short Date Format.

Lee @ Evans . Net

Reply With Quote
  #2  
Old November 9th, 2003, 08:41 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 33 m
Reputation Power: 181
Generally you'll have better luck getting a good answer if you only post your question once.

Reply With Quote
  #3  
Old November 10th, 2003, 02:41 AM
evanslee evanslee is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: manchester uk
Posts: 3 evanslee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sorry, unsure which section

sorry unsure which section is best, as its asp but ms access and sql question.


Lee

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Select nearest match based on 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 1 hosted by Hostway
Stay green...Green IT