Running Multiple Selection and Statistics queries

Discussion created by Sycosys on Oct 8, 2012
Latest reply on Oct 9, 2012 by clthompson

Im just starting to throw myself at a line query and statistics script and am a bit lost on a simple thing.

I have sorted out how to select various features and run a statistics export on that selection.

i am running into a problem trying to run multiple selections and append those statistics to the already created output DBF.

import arcpy
from arcpy import env

env.workspace = "C:/Users/X/Desktop/PNG HCA Program Dev/PNG_Planning_Map.mdb"
arcpy.SelectLayerByAttribute_management ("Testing", "NEW_SELECTION", " [PRESSURE1] = 300 and [CL_MAOP] = 3 ")
arcpy.Statistics_analysis("Testing", "C:/Users/X/Desktop/PNG HCA Program Dev/PNG_Planning_Map.mdb", [["Shape_Length", "SUM"]])
arcpy.SelectLayerByAttribute_management ("Testing", "NEW_SELECTION", " [PRESSURE1] = 0 and [CL_MAOP] = 4 ")
arcpy.Statistics_analysis("Testing", "C:/Users/X/Desktop/PNG HCA Program Dev/PNG_Planning_Map.mdb", [["Shape_Length", "SUM"]])

My error is

Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000725: Output Table: Dataset C:\Users\X\Desktop\PNG HCA Program Dev\PNG_Planning_Map.dbf already exists.

im sure it is something incredibly simple but i just need each query/stats result to be appended to the generated dbf.