Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A subscript must be between 1 and the size of the array?

Status
Not open for further replies.

smtoomey3

Technical User
Nov 8, 2005
69
US
Running a report and getting this error, can anyone tell where I'm going wrong with this formula?


stringVar array Years := ['2004','2005'];
stringVar array Months := ['01','02','03','04','05','06','07','08','09','10','11','12'];
if {OEHDRHST_SQL.inv_dt} = 0
then 'Zero Date'
else Years[Year(MACOLANumberToDate({OEHDRHST_SQL.inv_dt}))-2004]+'-'+Months[Month(MACOLANumberToDate({OEHDRHST_SQL.inv_dt}))]
 
year() in crystal returns an integer between 1 and 12 and your array is a string array.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top