Forums

ASP

This topic is locked

date query

Posted 11 Jan 2006 04:25:12
1
has voted
11 Jan 2006 04:25:12 robert mccombe posted:
Dim rsgigs
Dim rsgigs_numRows

Someone plz tell me why this ain't workin and why its not bringing back any records when i kno there is a record with the same date in the table

Set rsgigs = Server.CreateObject("ADODB.Recordset"
rsgigs.ActiveConnection = MM_thesource_STRING
rsgigs.Source = "SELECT * FROM Gigs WHERE day = #" & Date & "# order by day desc"
rsgigs.CursorType = 0
rsgigs.CursorLocation = 2
rsgigs.LockType = 1
rsgigs.Open()

rsgigs_numRows = 0

%>

Replies

Replied 16 Jan 2006 11:08:44
16 Jan 2006 11:08:44 Michael Behan replied:
The date (even if its not normally visible) might have a time associated with it. So for a selected date to 'equal' the date in the database it would also need to have the correct time.

try something like this

SELECT something FROM the_table WHERE day > date - 1

Reply to this topic