
November 9th, 2003, 05:50 PM
|
|
Registered User
|
|
Join Date: Nov 2003
Location: manchester uk
Posts: 3
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
|