macromedia.dreamweaver.appdev
[Top] [All Lists]

Re: how to search smalldatetime field with a querystring value? ASP/SQL

Subject: Re: how to search smalldatetime field with a querystring value? ASP/SQL
From: Dooza <doozadooza@xxxxxxxxx>
Date: Thu, 31 Jul 2008 15:21:19 +0100
Newsgroups: macromedia.dreamweaver.appdev


tradmusic.com wrote:
I'm passing the following date, via a querystring, to a page that has a recordset containing a smalldatetime field:
page.asp?eventdatetime=2008-09-26

Problem is, the recordset is either producing no results, despite there being events in the table, on that date. If I change the querystring to any of the following:
dd-mm-yyyy
dd/mm/yyyy
yyyy/mm/dd

I get an error about data type mismatch.

I know this is something silly...can anyone tell me what I'm doing wrong? Thank you.

Regards
Nath.
A querystring is a string value, you need to convert it to a date value before the recordset will accept it. Maybe CDATE will do it: http://www.w3schools.com/VBscript/func_cdate.asp

Steve

<Prev in Thread] Current Thread [Next in Thread>