> I tried this function but it keeps returning an error such as:
>
> ERROR: invalid input syntax for integer: "2007-05-05 00:34:08"
> SQL state: 22P02
> Context: PL/pgSQL function "lagfunc" line 10 at assignment
Whoops, this line:
> > client_id := thisrow.datetime;
Should be:
client_id := thisrow.client_id;