Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have the code below works great i

Status
Not open for further replies.

tekyge

Programmer
Dec 11, 2005
125
US
I have the code below works great if the CDate Value is True but if I change it to >Date it gives the below error?

'--
sql = "SELECT * FROM [Projects] WHERE [Projects].[ActID]=" &Trim(session("myvar1"))& " AND [Projects].[CDate]>Date" & " ORDER BY [Projects].[ProjectName] ASC"
rs.open sql, conn

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/login/cd/index.asp, line 37
 
Is Date in this case the name of a field?

Or are you trying to find records with a date after today? ... I mean do you intend to use the Date() function inline with the SQL ?



 
Got it

sql = "SELECT * FROM [Projects] WHERE [Projects].[ActID]=" &Trim(session("myvar1"))& " AND [Projects].[CDate]>Date()" & " ORDER BY [Projects].[ProjectName] ASC"
rs.open sql, conn

should have had the () at the end of date
 
sounds like CDATE field is not of date type...you need to use cast or convert functions

-DNG
 
thanks for the response I just saw it.
 
its a text field storing the date pulled from another form.

Thanks all
 
I spoke to soon it works but it ether show all records or none
 
Date() will give you 12AM of the current day... maybe you would reather use Now()
 
It works now with the following code, and date works great. Thanks for your help

sql = "SELECT * FROM Projects WHERE ActID=" & Trim(Session("myvar1")) & " AND Int(CDate)>Int(Date()) ORDER BY ProjectName"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top