> Can anyone help me on this. here is my querey and then the
> output. it seems to be rounding the SUM (TimeTaken) as TotalTime variable.
> im tring to get it to output something like 12.03 or 03.98 ect....
>
> <cfquery name="EventResults"
> datasource="#datasource#"
> dbtype="ODBC">
> SELECT ContestantID, SUM (AdjPoints) as TOTALPTS, SUM (Points) as
> PTS, SUM (TimeTaken) as TotalTime, RodeoID, Place
> FROM ResultsManager
> WHERE EventID = #url.EventID# AND RodeoID = #url.RodeoID#
> GROUP BY ContestantID, RodeoID, Place
> ORDER BY Place
> </cfquery>
>
> <cfoutput>#NumberFormat(EventResults.TotalTime,"___.__")#</cfoutput>
SQL Server outputs aggrigate functions on the field type of the field, thus
SUM, AVG etc. will remain an INT if they are an INT
If you want to have a FLOAT or NUMERIC as the return, then try;
SELECT ContestantID, SUM(CONVERT(FLOAT,AdjPoints)) as TOTALPTS
If the field isn't a numeric field type (i.e. DateTime or SmallDateTime)
then this (probably) won't give a decent answer anyway
Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
"Websites for the real world"
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists