protected static Ptg calcDCountA( Ptg[] operands )
	{
		if( operands.length != 3 )
		{
			return new PtgErr( PtgErr.ERROR_NA );
		}

		DB db = getDb( operands[0] );
		Criteria crit = getCriteria( operands[2] );
		if( (db == null) || (crit == null) )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		int fNum = db.findCol( operands[1].getString().trim() );
		if( fNum == -1 )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		int count = 0;

		// this is the colname to match
		String colname = operands[1].getValue().toString();
		for( int i = 0; i < db.getNRows(); i++ )
		{    // loop thru all db rows
			// check if current row passes criteria requirements
			if( crit.passes( colname, db.getRow( i ), db ) )
			{
				// passes; now do action
				String s = db.getCell( i, fNum ).getValue().toString();
				if( (s != null) && !s.trim().equals( "" ) )
				{
					count++;    // if field is not blank, increment count
				}
			}
		}

		return new PtgNumber( count );
	}