Hi Nick Thanks for that, it seems to be working! and yes it is an Oracle database ,
Thanks Ian ----- Original Message ----- From: "Nick de Voil" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, January 14, 2002 12:04 PM Subject: Re: Coldfusion & Intelligent Queries ??? > Oracle, right? > > AND eventdate >= SysDate > > should do it > > Nick > > ----- Original Message ----- > From: Ian Vaughan <[EMAIL PROTECTED]> > To: CF-Talk <[EMAIL PROTECTED]> > Sent: Monday, January 14, 2002 11:48 AM > Subject: Coldfusion & Intelligent Queries ??? > > > > Hi > > > > How do I modify my query below, so that when an event date has passed it > > is no longer shown, so for example if an event was on January 12 2002 , > > it would not show up in the results returned, it would only show the > > events happening from todays date i.e. January 14th. > > > > How could this feature be implemented into the code below, any ideas > > would be most appreciated. > > > > > > <cfset MonthsToDisplay = 2> > > <cfset BeginDate = "#Month(now())#/1/#Year(now())#"> > > <cfset EndDate = "#Month(DateAdd("m", > > MonthsToDisplay,now()))#/#DaysInMonth(DateAdd("m", > > MonthsToDisplay,now()))#/#Year(DateAdd("m", MonthsToDisplay, now())) #"> > > > > <cfquery name="getupcomingevents" datasource="events"> > > SELECT eventid, eventdate, to_char(eventdate,'YYYY') AS eventYear, > > to_char(eventdate,'MM') AS eventMonth, longtitle, location > > FROM whatson > > WHERE trunc(eventdate) BETWEEN > > TO_DATE('#DateFormat(variables.Begindate,"dd/mm/yyyy")#','DD/MM/YYYY' ) > > AND TO_DATE('#DateFormat(variables.Enddate,"dd/mm/yyyy")#','DD/MM/YYY Y') > > ORDER BY eventdate asc > > </cfquery> > > > > Thanks > > Ian > ______________________________________________________________________ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists