Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9585)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9586)
@@ -317,5 +317,9 @@
    done
    # add condition for the status of the step itself
-   query=$query" AND ISNULL("$step"Status.fStartTime) "
+   if [ $counter -gt 0 ]
+   then
+      query=$query" AND "
+   fi
+   query=$query" ISNULL("$step"Status.fStartTime) "
    query=$query" AND ISNULL("$step"Status.fStopTime) "
    query=$query" AND ISNULL("$step"Status.fReturnCode) "
