Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: How to compare date in SQL statement


Message #1 by "Kai" <csmh@g...> on Thu, 16 Aug 2001 16:06:25
Hi, everyone,

    I was trying to compare two dates in my SQL statement. The system 

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

No value given for one or more required parameters". The WHERE statement 

in my SQL code as following:

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

Table].CliIntakeDate <=strEndDate



strStarDate and strEndDate both are reading from user as following:

strStarDate=request.form("startDate")

strEndDate=request.form("endDate")



Is anyone could help me out? Thanks a lot!



Kai
Message #2 by "J House" <jesse@s...> on Thu, 16 Aug 2001 20:13:08
Maybe,

Use WHERE BETWEEN date1 AND date2



Also are you building you sql statement properly



sSql = sSql & " WHERE [Client Table].CliIntakeDate >= #" & strStartDate 

& "# AND [Client 

Table].CliIntakeDate <= #" & strEndDate & "#"

Access uses #'s around date values



hope this helps.





> Hi, everyone,

>     I was trying to compare two dates in my SQL statement. The system 

> keeps give me error: "Microsoft JET Database Engine (0x80040E10)

> No value given for one or more required parameters". The WHERE statement 

> in my SQL code as following:

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

Table].CliIntakeDate <=strEndDate

> 

> strStarDate and strEndDate both are reading from user as following:

> strStarDate=request.form("startDate")

> strEndDate=request.form("endDate")

> 

> Is anyone could help me out? Thanks a lot!

> 

> Kai
Message #3 by "Kai Fu" <csmh@g...> on Fri, 17 Aug 2001 14:35:41
Thanks for ur help, it works for me.



Kai

  Return to Index