Here's a solution, though not that simple.
First create a formula converting the ticket number to a value {@valtick}:
val({table.tickno})
Also create a second formula {@strtick} ensuring that the ticket number always has two digits:
totext({@valtick},"00"
Next, if you have a group, let's say on {table.stores}, create a reset formula {@resetaccum} to be placed in the group header:
whileprintingrecords;
stringvar accum := "";
Start by accumulating ticket numbers in {@accum} (to be placed in the details section):
whileprintingrecords;
stringvar accum;
if onfirstrecord or
{@valtick} = next({@valtick}) - 1 then
accum := accum + {@strtick} +"," else
accum := "";
Then create another formula {@result} also placed in the details section:
whileprintingrecords;
stringvar accum;
stringvar result;
if {table.store} = next({table.store}) and
{@valtick} < next({@valtick}) - 1 and
len(accum) > 0 then
result := left(accum,2)&" "&{@strtick} else
if {table.store} = next({table.store}) and
{@valtick} < next({@valtick}) -1 and
len(accum) = 0 then
result := {@strtick} &" "&{@strtick} else
if {table.store} <> next({table.store}) and
len(accum) > 0 then
result := left(accum,2) &" "&{@strtick} else
if {table.store} <> next({table.store}) and
len(accum) = 0 then
result := {@strtick} &" "&{@strtick};
The above assumes a two-digit ticket number, but you could adapt this to higher numbers by changing the format for {@strtick} and changing the numbers where the "left" function is used.
You can suppress {@accum} and then go to format section->details->suppress if blank to get rid of excess white space.
-LB