Index: trunk/ippToPsps/jython/stackbatch.py
===================================================================
--- trunk/ippToPsps/jython/stackbatch.py	(revision 36147)
+++ trunk/ippToPsps/jython/stackbatch.py	(revision 36190)
@@ -243,5 +243,5 @@
             cnt=cnt+1
             
-        sql=sql+"WHERE a.ippDetectID=b.IPP_IDET AND b.PSF_FWHM "+psfCondition     
+        sql=sql+"WHERE a.ippDetectID=b.IPP_IDET AND  "+psfCondition     
         self.scratchDb.execute(sql)
 
@@ -633,10 +633,14 @@
 
         # TODO temporarily loading 1st convolved fluxes into unconvolved fields
+
+        #This assumes that there are 3 different fluxs, the first is unconv, and the 2nd and 3rd are convolved. If there are more than 3 fluxes it will break.   
+        # If there are more than 3 types of fluxes, we should do a count to find out how many there are and adjust this accordingly (make it more robust)
+
         self.logger.infoPair("Adding fluxes", "un-convolved")
-        self.updateApFlxs("", "IS NULL")
+        self.updateApFlxs("", "((b.table_index -1) % 3 = 0)")
         self.logger.infoPair("Adding fluxes", "1st convolved")
-        self.updateApFlxs("c1", "< 7.0")
+        self.updateApFlxs("c1", "((b.table_index -1) % 3 = 1)")
         self.logger.infoPair("Adding fluxes", "2nd convolved")
-        self.updateApFlxs("c2", "> 7.0")
+        self.updateApFlxs("c2", "((b.table_index -1) % 3 = 2)")
 
         self.logger.infoPair("Adding", "petrosians for extended sources")
