Topic: [Скрипт] Счетчик с автоматическим обнулением в следующем году

Позволяет создавать идентификатор для новый записей вида

1/2015
2/2015
3/2015
....
1/2016
2/2016


procedure frmEmployee_OnShow (Sender: string; Action: string);
begin
    if Action='NewRecord' then
    begin
        frmEmployee.edYear.Text := FormatDateTime('yyyy', now);
        frmEmployee.edID.Text := SQLExecute ('SELECT IFNULL(MAX(ident), 0)+1 FROM person WHERE year='+FormatDateTime('yyyy', now) );
        frmEmployee.edIdYear.Text:= frmEmployee.edID.Text + '/' + frmEmployee.edYear.Text;
    end;
end;


Проект с примером:

Post's attachments

Attachment icon CounterEx with year.zip 5.55 kb, 841 downloads since 2015-05-04 

Dmitry.