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 even if
date parts are same...
you will need to use your db's date/time functions to select only the
DATE part of these fields and compare/output those.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



alex poyaoan wrote:
> 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>
>       
>       <cfset EndDate="#getevents.enddate#">
>       <cfset hyphen="-">
>       
> </cfif> 
> </cfoutput>
>
>
> <cfoutput query="getevents">
> #StartDate# #hyphen# #EndDate#
> </cfoutput>
>
> With the conditional statement cfif if the startdate  = enddate i need only 
> to see the startdate without the hyphen otherwise it gives me both dates with 
> the hyphen ..
>
> my code above doesn't work 
>
>   

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315186
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to