select customer, task, date()-duedate as duedate ; from myTable ; into cursor myCursor *Crosstab *Extra overhead to convert nums to datesAn alternative is to build your own crosstabber. ie:
* Test file creation Create cursor crosstabme (customer c(15), task c(15), duedate d) Rand(-1) For ix=1 to 10 For jx=1 to 24 If int(rand()*1000)%2=1 Insert into crosstabme ; values ('Customer No '+padl(ix,3,'0'), ; 'Task No '+padl(jx,3,'0'), ; date()+int(rand()*100)) Endif Endfor Endfor Index on customer+task tag main * Test file creation External array arrRows, arrCols * Cols array Select distinct task from crosstabme ; order by task ; into array arrCols lnFields = alen(arrCols,1)+1 Dimension arrCrossTabStruc[lnFields,4] For ix=1 to lnFields arrCrossTabStruc[ix,1] = 'Task'+padl(ix-1,3,'0') && Fieldnames Task001,Task002... arrCrossTabStruc[ix,2] = 'C' arrCrossTabStruc[ix,3] = max(fsize('Task','crosstabme'),10) && 10 is transform(date()) with century size arrCrossTabStruc[ix,4] = 0 Endfor arrCrossTabStruc[1,1] = 'Customer' arrCrossTabStruc[1,3] = fsize('Customer','crosstabme') * Rows array Select distinct customer from crosstabme ; into array arrRows ; order by 1 Create cursor crsTabbed from array arrCrossTabStruc Dimension arrFirstRow[lnFields] arrFirstRow[1]='' Acopy(arrCols,arrFirstRow,1,-1,2) Insert into crsTabbed from array arrFirstRow For ix=1 to alen(arrRows,1) && For each customer Scatter memvar blank && create blank memvars for this customer m.customer = arrRows[ix] && Customer name For jx=1 to alen(arrCols,1) && For each task If seek(arrRows[ix]+arrCols[jx],'CrossTabMe','Main') Store transform(crosstabme.duedate) to ('m.Task'+padl(jx,3,'0')) Endif Endfor Insert into crsTabbed from memvar Endfor BrowseThis one is easy to get rid of first row (long field name header as is) and converting char dates to datetype is a snap if desired.