Hi,
&&Select count of reccords in the table myTable
select count(*) as reccnt,animal from myTable group by animal into cursor _myTable
scan for reccnt>1
delete from myTable where animal=_myTable.animal
insert into myTable (animal) values(_myTable.animal
endscan
&& if You use SQL Server, can use delete with subquery
About difference in minutes use datetime format, for example:
date1="01/01/2002 18:30"
date2="02/01/2002 8:00"
?(date2-date1)/60 will give you a correct answer
Best regards
Sevdalina Draganova