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/YYYY')
> ORDER BY eventdate asc
> </cfquery>
>
> Thanks
> Ian
______________________________________________________________________
Why Share?
  Dedicated Win 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=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to