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
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
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
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,
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
5 matches
Mail list logo