Forums

ASP

This topic is locked

Passing Dates to Query

Posted 08 Aug 2002 10:43:35
1
has voted
08 Aug 2002 10:43:35 John Gallagher posted:
I am working on a small newspaper and need to archive issues, I have articles, categories, subcats and isseue in there own tables. Here is what I want to do.

1. Display dates on an archive page based on the issue date and getting data fron issue_date in the issue table. (this is not a problem)

2. When a user clicks on a date I want the next page (front of that issue) to filter the records by date, e.g www.mysite.com/archive/default.asp?issuedate=30-08-2002.

I have tried various date formats and used #'s in the query like most of the tutorials told me to do when using access but I cant get UD to give me any results unless I set a default value in the Recordset variables and then it will only return that date.

It looks like the first page is not sending the date in the right format.

I know this sounds a bit all over the place but it's done with php on some sites I have seen.

Replies

Replied 09 Aug 2002 17:31:50
09 Aug 2002 17:31:50 danhq  replied:
while i have no direct answer for your question, i've had success using a form field with the date displayed as m/d/yyyy, the 'get' method, and the query for the following page set to

SELECT *
FROM OrdersQuery
WHERE OrderDate = #varDate#

(where #varDate#=request.querystring("date")

-dan.

Reply to this topic