Re: [KCFusion] Select in Date Range
Two thoughts, you might want to try and , or better yet = and = instead of between. Also, if you intend to search through 12-15, move your date to midnight 12-16. At 11:34 AM 2/10/2003 -0600, you wrote: Okay I know this should be easy but I am not having any success. I want to select betwee two dates. Here is my query, what am I doing wrong. cfquery datasource=date name=name select * from request where closed between '2002-10-01 00:00:00' AND '2002-12-15 00:00:00' order by closed /cfquery Christopher V. Holdman [EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
Re: [KCFusion] Select in Date Range
What are you getting when you run this? An error or an empty record set? A. - Original Message - From: Chris Holdman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:34 AM Subject: [KCFusion] Select in Date Range Okay I know this should be easy but I am not having any success. I want to select betwee two dates. Here is my query, what am I doing wrong. cfquery datasource=date name=name select * from request where closed between '2002-10-01 00:00:00' AND '2002-12-15 00:00:00' order by closed /cfquery Christopher V. Holdman [EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] Select in Date Range
I get an error ODBC Error Code = 22005 (Error in assignment) [Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression. The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (3:1) to (3:40). Christopher V. Holdman Webmaster - City of Olathe (913) 971-6286 (913) 238-4681 Cell [EMAIL PROTECTED] -Original Message- From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 11:48 AM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] Select in Date Range What are you getting when you run this? An error or an empty record set? A. - Original Message - From: Chris Holdman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:34 AM Subject: [KCFusion] Select in Date Range Okay I know this should be easy but I am not having any success. I want to select betwee two dates. Here is my query, what am I doing wrong. cfquery datasource=date name=name select * from request where closed between '2002-10-01 00:00:00' AND '2002-12-15 00:00:00' order by closed /cfquery Christopher V. Holdman [EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]
RE: [KCFusion] Select in Date Range
This worked... cfset date1 = '2002-10-01' cfset date2 = '2002-12-15' cfquery datasource=data name=name select * from request where closed between #CreateODBCDate(date1)# and #CreateODBCDate(date2)# order by closed /cfquery I think the error was because the dates I entered were not in a valid date format, and the I was getting a conversion error trying to convert it. The database was probably trying to compare between character strings, not actual date fields. So I set the dates and use CreateODBCDate to make sure they were using the same date structure. Thank for the comments. Christopher V. Holdman Webmaster - City of Olathe (913) 971-6286 (913) 238-4681 Cell [EMAIL PROTECTED] -Original Message- From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 11:59 AM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] Select in Date Range Ok it looks like you are giving Access two strings insted of two dates. Im assuming the field is of type date so either toss # signs around your dates or use the DATEPART function. A. - Original Message - From: Chris Holdman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:43 AM Subject: RE: [KCFusion] Select in Date Range I get an error ODBC Error Code = 22005 (Error in assignment) [Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression. The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (3:1) to (3:40). Christopher V. Holdman Webmaster - City of Olathe (913) 971-6286 (913) 238-4681 Cell [EMAIL PROTECTED] -Original Message- From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 11:48 AM To: [EMAIL PROTECTED] Subject: Re: [KCFusion] Select in Date Range What are you getting when you run this? An error or an empty record set? A. - Original Message - From: Chris Holdman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:34 AM Subject: [KCFusion] Select in Date Range Okay I know this should be easy but I am not having any success. I want to select betwee two dates. Here is my query, what am I doing wrong. cfquery datasource=date name=name select * from request where closed between '2002-10-01 00:00:00' AND '2002-12-15 00:00:00' order by closed /cfquery Christopher V. Holdman [EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED] __ The KCFusion.org list and website is hosted by Humankind Systems, Inc. List Archives http://www.mail-archive.com/cf-list@kcfusion.org Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED] To Subscribe mailto:[EMAIL PROTECTED] To Unsubscribe mailto:[EMAIL PROTECTED]