Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: How to compare two dates in SQL statement


Message #1 by "Kai Fu" <CSMH@g...> on Fri, 17 Aug 2001 14:29:50
Hi, everyone,

   I was trying to compare two dates in my SQL statement, but the system 

keeps giving me error: Microsoft JET Database Engine (0x80040E10)

 No value given for one or more required parameters.

I first read two dates from text boxes as following:

	strStartDate=request.form("StartDate")

	strEndDate=request.form("EndDate")

then my WHERE statement in my SQL statement as following:

WHERE [Client Table].CliIntakeDate >=strStartDate And [Client 

Table].CliIntakeDate <=strEndDate



Is anyone could help me out? thanks a lot!



Kai

Message #2 by "Hans van Domselaar" <Hans.van.Domselaar@i...> on Fri, 17 Aug 2001 15:39:12 +0200
I am not sure but you have to compose your Where-clause as a string

with date literals.

A date literal is a string in the format #mm/dd/yyyy#.



-----Original Message-----

From: Kai Fu [mailto:CSMH@g...]

Sent: vrijdag 17 augustus 2001 16:30

To: Access ASP

Subject: [access_asp] How to compare two dates in SQL statement





Hi, everyone,

   I was trying to compare two dates in my SQL statement, but the system



keeps giving me error: Microsoft JET Database Engine (0x80040E10)

 No value given for one or more required parameters.

I first read two dates from text boxes as following:

	strStartDate=3Drequest.form("StartDate")

	strEndDate=3Drequest.form("EndDate")

then my WHERE statement in my SQL statement as following:

WHERE [Client Table].CliIntakeDate >=3DstrStartDate And [Client

Table].CliIntakeDate <=3DstrEndDate



Is anyone could help me out? thanks a lot!



Kai


  Return to Index