Greetings all...
INFORMIX 7.2x (pre-Y2K)
ISQL 7.21
HPUX 11.x
Question:
Is there a way in to do an aggregate sum on a text column containing
numbers?
It is always possible the data could have text in it, and I must skip those
records. I created a stored procedure language (SPL) that takes the date
received (four digit form) and subtracts the order date to give you the age
at the time of receipt. It works well, returning BAD if the dates exceed
parameter values such as having text or a null value. That is, the return
value is a text field, not an integer, even if it contains numbers.
It returns "BADxxx" if it errors (specific codes for -696 or -306, OTH for
everything else).
The dates are UNIX equivalents of the serial day function (date %+j) and the
last digit of the year.
Conditions: I can't use global variables and I can't store it in the
operating system. It must be totally self contained for portability.
Example:
p_aging (receipt_date4,order_date4)
For a record:
p_aging ("7031","6364")
Where 7031 is January 31, 2007 and 6364 is December 30, 2006
The dates are the last digit of the year and three digit serials for the
day.
Any ideas?
Thanks!
Rob