Re: problem with cfif conditions on dates

2008-11-13 Thread Azadi Saryev
all you need for your desired output is: cfquery ... /cfquery cfoutput query=getevents #StartDate#cfif startdate neq enddate - #EndDate#/cfif /cfoutput however, keep in mind that if your startdate and enddate db fields also include TIME part, your stratdate will not be equal to enddate

Re: problem with cfif conditions on dates

2008-11-13 Thread alex poyaoan
Thanks so much that did it .. It's just so simple but i've complicated myself from my original code.. again thanks all you need for your desired output is: cfquery ... ... /cfquery cfoutput query=getevents #StartDate#cfif startdate neq enddate - #EndDate#/cfif /cfoutput however, keep in

RE: problem with cfif conditions on dates

2008-11-13 Thread Adrian Lynch
Or use CF's if you can't change the SQL. DateFormat(startDate, ddmmyy) NEQ DateFormat(endDate, ddmmyy) Adrian Building a database of ColdFusion errors at http://cferror.org/ -Original Message- From: Azadi Saryev Sent: 13 November 2008 10:49 To: cf-talk Subject: Re: problem with cfif

Re: problem with cfif conditions on dates

2008-11-13 Thread Jason Fisher
You've already got the solution, but here's a bit of explanation as well. The reason the original was giving unexpected answers is this block: cfif #getevents.StartDate# eq #getevents.EndDate# When that runs outside of a query loop or query output, then it is pulling the first query record,

problem with cfif conditions on dates

2008-11-13 Thread alex poyaoan
HI everybody have this problem with this query.. CFQUERY NAME=GetEvents DATASOURCE=events SELECT c.startdate, c.endDate FROM CalendarEvents c /CFQUERY cfoutput cfif #getevents.StartDate# eq #getevents.EndDate# cfset EndDate= cfset hyphen= cfelse