Re: help, More Group by Month
Date is a reserved word - Original Message - From: Jeff Fongemie [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Wednesday, May 02, 2001 10:25 AM Subject: help, More Group by Month Hello All , still trying to get this thing to work. Why does this error? My field names are ID, date and name. cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT date, name FROM entertain GROUP BY DATEPART(m,date) ORDER BY month /cfquery Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] Internet Guns For Hire (603) 356-0768 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: help, More Group by Month
This won't work because you are including a column (name) in your select list that is not included in an aggregate function, which you need to do if you are grouping -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: 02 May 2001 15:26 To: CF-Talk Subject: help, More Group by Month Hello All , still trying to get this thing to work. Why does this error? My field names are ID, date and name. cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT date, name FROM entertain GROUP BY DATEPART(m,date) ORDER BY month /cfquery Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] Internet Guns For Hire (603) 356-0768 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: help, More Group by Month
Jeff; I think if you were to change the name of your column from date to some_date or something other than Date, you will take care of a lot of your problem. Larry Juncker Senior Cold Fusion Developer Heartland Communications Group, Inc. -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 9:26 AM To: CF-Talk Subject: help, More Group by Month Hello All , still trying to get this thing to work. Why does this error? My field names are ID, date and name. cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT date, name FROM entertain GROUP BY DATEPART(m,date) ORDER BY month /cfquery Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] Internet Guns For Hire (603) 356-0768 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: help, More Group by Month
To elaborate on this: cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT date, name FROM entertain GROUP BY DATEPART(m,date) ORDER BY month /cfquery If you want to group by DATEPART(m,date) then this must by in your select clause instead of date. The following for example will work: cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT DATEPART(m,date) FROM entertain GROUP BY DATEPART(m,date) /cfquery If you want to include name and order by month these have to either be included i the group by clause OR be part of an agregate function (like MAX for example). HTH -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Andy Ewings [mailto:[EMAIL PROTECTED]] Sent: 02 May 2001 15:31 To: CF-Talk Subject: RE: help, More Group by Month This won't work because you are including a column (name) in your select list that is not included in an aggregate function, which you need to do if you are grouping -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 488 9131 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Jeff Fongemie [mailto:[EMAIL PROTECTED]] Sent: 02 May 2001 15:26 To: CF-Talk Subject: help, More Group by Month Hello All , still trying to get this thing to work. Why does this error? My field names are ID, date and name. cfquery name=event datasource=#application.dsn# dbtype=ODBC SELECT date, name FROM entertain GROUP BY DATEPART(m,date) ORDER BY month /cfquery Best regards, Jeff Fongemie mailto:[EMAIL PROTECTED] Internet Guns For Hire (603) 356-0768 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists