[Emerald] Corrupt records?

Brian Dooley ( support@cserv.net )
Wed, 27 Sep 2000 17:56:20 -0400

I am sure someone has done this another way but I found it useful for my
needs. Occasionally due to power interruptions etc. my Calls table
suffers corrupt information for time online. Some data may reflect
average calls as -14,568 minutes or 16,489 minutes in the reports (just
examples). Normally the average call is under an hour. In order to get
more accurate measurements of users time online, I created the following
Stored Procedures in SQL 7.0

I took the DeleteStartRecords Stored Procedure and modified it to create
two new ones.
86400 is the total number of seconds in a week.
I called them DeleteCorruptUpperRecords and DeleteCorruptUpperRecords.
I then added a new job to run on the 28th of each month with these as
Step1 and Step2.

Here are the Procedures

CREATE PROC DeleteCorruptLowerRecords AS
Delete From Calls Where AcctSessionTime < 0

CREATE PROC DeleteCorruptUpperRecords AS
Delete From Calls Where AcctSessionTime > 86400

Anyone know of a better way to do this, I would love to hear it.

----------------------------------------------------------Brian DooleyClassic Servicehttp://www.classicservice.net

`````````````````````````````````````````````````````````` - Man cannot survive except by gaining knowledge, and reason is his only means to gain it.-

Ayn Rand

For more information about this list (including removal) go to:http://www.iea-software.com/support/maillists/liststart