I suspect dte_2dlcl is the name of a date/time column in his database. Though it shouldn't be surrounded in single quotes if that's the case.
On Thu, Jan 13, 2011 at 3:23 PM, Russ Michaels <r...@michaels.me.uk> wrote: > > Well dte_2dlcl is not a valid enddate for a start. > You also need to make sure the dates are in the proper format the database > understands. > > If your using sql server > http://msdn.microsoft.com/en-us/library/aa258269%28v=sql.80%29.aspx > > Russ > > -----Original Message----- > From: Jay Birdsell [mailto:john_birds...@hotmail.com] > Sent: 13 January 2011 19:41 > To: cf-talk > Subject: help w/ DateDiff() please > > > The dateDiff () is killing me! can someone please look at this and help me > clear my head. > > What I have is a db that tracks executive correspondence when drafts are > due and when the final response is due. I need a report that will list > any > correspondence that has a draft or final date within 8 days of the run date > (today). I've read that i should be able to do this right in the select > statement. However I have found a clean concise example here is what I have > tried so far; > > try # 1:: > <cfquery name="final8" datasource="dev11g" > > select dateDiff('d',#today#,'dte_2dlcl') as m > from execcoresp000 > </cfquery> > > Results:: Error - "DateDiff invalid identifier" > > try# 2 > > <cfquery name="final8" datasource="dev11g" > > select dateDiff('d',#today#,'dte_2dlcl') as m > from execcoresp000 > where m < 8 > </cfquery> > Results: Error M invalid identifier > > try # 3 > <cfquery name="final8" datasource="dev11g" > > select dte_2dlcl > from execcoresp000.correspondence > where dateDiff('d',#today#,'dte_2dlcl')< 8 > </cfquery> > Results: Error - "DateDiff invalid identifier" > > > The other error i tend to get is "Missing right parenthese" > > i really dont want to get in a bunch of nested loops to do this. any > ideas? > > tia, > > jbird > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340779 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm