Does anyone have a working example of how to select on a date/time column in an MSAccess database. Something like Arguments: FromDate:date select * from "Applicant Database" where [Date Received] > <dtml-sqlvar FromDate type=float> ...except the above syntax produces: Error type: sql.error Error value: ('07001', -3010, '[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.') ...regardless of value of type. -- Thanks -- Loren
Loren Stafford wrote:
Does anyone have a working example of how to select on a date/time column in an MSAccess database.
Something like
Arguments: FromDate:date
select * from "Applicant Database" where [Date Received] > <dtml-sqlvar FromDate type=float>
...except the above syntax produces:
Error type: sql.error Error value: ('07001', -3010, '[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.')
...regardless of value of type.
-- Thanks -- Loren
I think MSAccess expects it's dates to be delimited by # as in: #7/6/2001# You might try: select * from "Applicant Database" where [Date Received] > #<dtml-var FromDate fmt="%x" sql_quote># -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Well I knew that it was something like that! Laurie -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Casey Duncan Sent: Friday, July 06, 2001 3:18 PM To: Loren Stafford Cc: zope@zope.org Subject: Re: [Zope] ZSQL select on date/time Loren Stafford wrote:
Does anyone have a working example of how to select on a date/time column
in
an MSAccess database.
Something like
Arguments: FromDate:date
select * from "Applicant Database" where [Date Received] > <dtml-sqlvar FromDate type=float>
...except the above syntax produces:
Error type: sql.error Error value: ('07001', -3010, '[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.')
...regardless of value of type.
-- Thanks -- Loren
I think MSAccess expects it's dates to be delimited by # as in: #7/6/2001# You might try: select * from "Applicant Database" where [Date Received] > #<dtml-var FromDate fmt="%x" sql_quote># -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------> _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Thanks, That put me on the right track. I also found a how-to on the subject http://www.zope.org/Members/teyc/howSQLDateTime, which suggests: select * from activity where activity_date= { ts '<dtml-var Mydate fmt=ISO>'} My final ZSQL method is: select * from "Applicant Database" where [Last Name] like <dtml-sqlvar LastName type=string> and [First Name] like <dtml-sqlvar FirstName type=string> and Position like <dtml-sqlvar Position type=string> and [Date Received] between { ts '<dtml-var FromDate fmt=ISO sql_quote>'} and { ts '<dtml-var ThruDate fmt=ISO sql_quote>'} -- Loren
Loren Stafford wrote:
Does anyone have a working example of how to select on a
date/time column in
an MSAccess database.
Something like
Arguments: FromDate:date
select * from "Applicant Database" where [Date Received] > <dtml-sqlvar FromDate type=float>
...except the above syntax produces:
Error type: sql.error Error value: ('07001', -3010, '[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.')
...regardless of value of type.
-- Thanks -- Loren
I think MSAccess expects it's dates to be delimited by # as in: #7/6/2001#
You might try:
select * from "Applicant Database" where [Date Received] > #<dtml-var FromDate fmt="%x" sql_quote>#
-- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
Usually with Access you need to have # around your dates. hth Laurie btw - the space in the column name - DON'T DO IT!!! (if you can help it - it just makes life difficult!) -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Loren Stafford Sent: Friday, July 06, 2001 3:08 PM To: zope@zope.org Subject: [Zope] ZSQL select on date/time Does anyone have a working example of how to select on a date/time column in an MSAccess database. Something like Arguments: FromDate:date select * from "Applicant Database" where [Date Received] > <dtml-sqlvar FromDate type=float> ...except the above syntax produces: Error type: sql.error Error value: ('07001', -3010, '[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.') ...regardless of value of type. -- Thanks -- Loren _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Casey Duncan -
Laurie Nason -
Loren Stafford