| Archives of the TeradataForumMessage Posted: Wed, 19 Aug 2009 @ 12:33:39 GMT
 
 
  
| Subj: |  | Re: 7453: interval field overflow. |  |  |  | From: |  | Geoffrey Rommel |  
 The SQL manuals explain all this in detail, but here are the key points.  Date1 - date2 returns an INTEGER (the number of days between the two
dates).  Between '0001-01-01' and '9999-12-31' there are fewer than 4 million days, so an integer will handle any possible difference. However, this expression: 
     (DATE - DATE '2008-07-01') DAY
 returns an INTERVAL DAY. The fields within an interval are smallints, so they cannot be more than 32767; moreover, the ANSI standard (?)
limits the interval fields to 4 digits (PIC 9999, you might say). Hence any difference over 9999 days will give a 7453 error. 
 
 |