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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datediff "too few parameters"

Status
Not open for further replies.

deepsheep

Programmer
Sep 13, 2002
154
CA
Well I have an interesting one.

I have a query that runs fine though access, but not through my program. The query is:
select * from servers where (datediff("n",LastGoodConnect, Now() ) > 14)
I get an error that says "too few parameters. Expected 1." All the field names and datatypes are correct and, as I've said, it runs perfectly fine when I copy & paste it into an access query.

My program is written in VB6 and I'm using ADO to talk to access 2000.

Any ideas?
 
And this ?
select * from servers where 1440*(Now()-LastGoodConnect) > 14

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well I got it figured. It didn't like the double quotes around the n for minute. I changed it to single quotes and it seems to work fine. This is even though the documentation I could find said double and running the query through Access worked.

Thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top