else
} else {
  protected String formCargoLegSql (FilterClauses filterClauses, int recentRun) {	String locTable = DGPSPConstants.LOCATIONS_TABLE + "_" + recentRun;	String conveyedLegTable = DGPSPConstants.CONVEYED_LEG_TABLE + "_" + recentRun;	String assetInstanceTable = DGPSPConstants.ASSET_INSTANCE_TABLE + "_" + recentRun;	String assetItineraryTable = DGPSPConstants.ASSET_ITINERARY_TABLE + "_" + recentRun;	String conveyanceInstanceTable = DGPSPConstants.CONV_INSTANCE_TABLE + "_" + recentRun;	String conveyancePrototypeTable = DGPSPConstants.CONV_PROTOTYPE_TABLE + "_" + recentRun;	String instanceProto     = assetInstanceTable + "." + DGPSPConstants.COL_PROTOTYPEID;	String assetInstanceOwner = assetInstanceTable + "." + DGPSPConstants.COL_OWNER;	String assetInstanceID    = assetInstanceTable + "." + DGPSPConstants.COL_ASSETID;	String itinID             = assetItineraryTable + "." + DGPSPConstants.COL_ASSETID;	String itinLeg            = assetItineraryTable + "." + DGPSPConstants.COL_LEGID;	String cLegID      = conveyedLegTable + "." + DGPSPConstants.COL_LEGID;	String cLegStartLoc= conveyedLegTable + "." + DGPSPConstants.COL_STARTLOC;	String cLegEndLoc  = conveyedLegTable + "." + DGPSPConstants.COL_ENDLOC;	String cLegStart   = conveyedLegTable + "." + DGPSPConstants.COL_STARTTIME;	String cLegEnd     = conveyedLegTable + "." + DGPSPConstants.COL_ENDTIME;	String cLegType    = conveyedLegTable + "." + DGPSPConstants.COL_LEGTYPE;	String cLegConvID  = conveyedLegTable + "." + DGPSPConstants.COL_CONVEYANCEID;	String cLegReadyAt = conveyedLegTable + "." + DGPSPConstants.COL_READYAT;	String l1id     = "l1" + "." + DGPSPConstants.COL_LOCID;	String l1geoloc = "l1" + "." + DGPSPConstants.COL_GEOLOC;	String l1name   = "l1" + "." + DGPSPConstants.COL_PRETTYNAME;	String l2id     = "l2" + "." + DGPSPConstants.COL_LOCID;	String l2geoloc = "l2" + "." + DGPSPConstants.COL_GEOLOC;	String l2name   = "l2" + "." + DGPSPConstants.COL_PRETTYNAME;		String ciPrototypeID = conveyanceInstanceTable + "." + DGPSPConstants.COL_PROTOTYPEID;	String ciConvID      = conveyanceInstanceTable + "." + DGPSPConstants.COL_CONVEYANCEID;	String ciBumper      = conveyanceInstanceTable + "." + DGPSPConstants.COL_BUMPERNO;	String cpPrototypeID = conveyancePrototypeTable + "." + DGPSPConstants.COL_PROTOTYPEID;	String cpConvType    = conveyancePrototypeTable + "." + DGPSPConstants.COL_CONVEYANCE_TYPE;	String cpNomen       = conveyancePrototypeTable + "." + DGPSPConstants.COL_ALP_NOMENCLATURE;	String wherePrefix = 	  filterClauses.getUnitWhereSql (assetInstanceOwner);	if (wherePrefix.equals(""))	  wherePrefix = "\nwhere ";	else	  wherePrefix += "\nand ";	String sqlQuery = 	  "select " + cLegID + ", " + cLegStart + ", " + cLegEnd + ", " + cLegReadyAt + ", " + l1geoloc + ", " + l1name +	  ",\n" + l2geoloc + ", " + l2name + ", " + cpConvType + ", " + cLegType + ", " + assetInstanceID + 	  ",\n" + ciConvID + ", " + instanceProto + ", " + cpNomen + ", " + ciBumper +	  "\nfrom " + locTable + " l1, " + locTable + " l2, " + assetInstanceTable + ", " + assetItineraryTable + ",\n" +	  conveyedLegTable + ", " + conveyanceInstanceTable + ", " + conveyancePrototypeTable + //", " + assetProtoTable +	  wherePrefix + 	  assetInstanceID + " = " + itinID + 	  "\nand " + itinLeg + " = " + cLegID +	  "\nand " + cLegStartLoc + " = " + l1id +	  "\nand " + cLegEndLoc + " = " + l2id +	  //  "\nand " + cLegType + " <> " + DGPSPConstants.LEG_TYPE_POSITIONING + 	  //  "\nand " + cLegType + " <> " + DGPSPConstants.LEG_TYPE_RETURNING +	  "\nand " + cLegConvID + " = " + ciConvID +	  "\nand " + ciPrototypeID + " = " + cpPrototypeID +	  //	  "\nand " + prototypeParentProto + " = " + instanceProto +	  "\norder by " + assetInstanceID + ", " + cLegStart;	if (debug) 	  System.out.println ("UnitQuery.formCargoLegSql - \n" + sqlQuery);		return sqlQuery;  }