Tried to do this a while back; this required creating the stored procedure 
aging.sql.  When I try to run that in ISQL/W, I get the following:
Msg 156, Level 15, State 1
Incorrect syntax near the keyword 'as'.
Msg 137, Level 15, State 1
Must declare variable '@custid'.
Msg 137, Level 15, State 1
Must declare variable '@a0'.
Msg 137, Level 15, State 2
Must declare variable '@custid'.
Msg 137, Level 15, State 1
Must declare variable '@idays'.
Msg 137, Level 15, State 2
etc.
What am I missing here?
--Ben
+--------------------------------------------------------------------------+
+   Ben Conner                             ben@webworldinc.com             +
+   Web World, Inc.                        (714) 639-0595 voice            +
+   PO Box 6548-107                        (714) 744-4825 fax              +
+   Orange, Ca   92863                                                     +
+--------------------------------------------------------------------------+
For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart