Jan Theofel <theofel(at)etes(dot)de> writes:> But what I need is the total difference in days as integer.
Subtract the dates.
regression=# select date('2002-08-13') - date('2002-07-13'); ?column?---------- 31(1 row)
regards, tom lane