Subject Re: [ib-support] Duplication records
Author Svein Erling Tysvær
Hi Lee,

INSERT INTO PIM (listoffieldstoinsert)
SELECT somefields, DATE_START + :DaysToMove, morefields
FROM PIM
WHERE keyfield = :SomeValue
Prepare the statement, set the parameters
(ParamByName(:DaysToMove).AsInteger:=something;) and execute the statement.

Simple and easy,
Set

>In a database I got appointments with a timestamp field.
>How can I duplicate a specific appointment to another date ?
>So suppose I got a appointment on 2001/01/01 and I want to duplicate
>this appointment to 2001/02/01 how do I write a sql command for this ?
>The appointment fields are the same, only the timestamp field is
>different.
>I know how to move :
>('update PIM set DATE_START = DATE_START + ' + IntTostr(Days_To_Move)
>+ ' where DATE_START = ' + Date_Start_String);
>But what is the syntax for duplicating a record?