Uhhh... are the two fields you are adding together numeric?

-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 3:26 PM
To: CF-Community
Subject: NVL in Sum statement


Select SUM (NVL(RegHrs + OThrs,0))AS TotalHours 
                        
                        FROM TblMainEntry,TblDetailEntry
                
                        WHERE TblMainEntry.EmpID =
#GetEmployees.Employee_ID#
                        
                        AND tblDetailEntry.RecordDate =
to_date('#currentdate#','mm/dd/yyyy')
                                
                        AND tblMainEntry.MainID = TblDetailEntry.MainID


If RegHrs + Othrs is NULL..shouldn't TotalHours be equal to zero?

If it is Null...then my statement further down which is :

<CFSET TotalWeekHrs = #TotalWeekHrs# + #GetHours.TotalHours#>

Fails..with CF throwing an error saying that it Cannot convert to number


*sigh*

What am I doing wrong now? :)

-Gel


______________________________________________________________________
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

Reply via email to