It is early and my brain my not be functioning 100% but may need to add a GROUP BY for the HAVING to function on some DBs.
On 10/15/07, James Smith <[EMAIL PROTECTED]> wrote: > > With some DB's moving your criteria from the WHERE clause to the HAVING > clause will take care of it since HAVING is evaluated after the results > have > been calculated... sometimes... > > -- > Jay > > -----Original Message----- > From: [EMAIL PROTECTED] [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 13 October 2007 00:01 > To: CF-Talk > Subject: SQL Concat Issue > > I am probably being dense or showing my ignorance here, but I have a > legacy > database that I need to run a query on like the following. Can anyone tell > me how I can achieve the following. Right now I am getting an error that > PubYear is not a valid column. Thank you! > > SELECT AdINFO_Publication, > ADINFO_PUBLICATIONDATE_YEAR+ '-' + > ADINFO_PUBLICATIONDATE_MONTH + '-01' AS PubYear > FROM crAdInfo > AND PubYear BETWEEN #dateformat(startdate,"yyyy-mm-dd")# > AND #dateformat(enddate,"yyyy-mm-dd")# > > Any Help is appreciated. Thanks! > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291082 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4