>Hello all
>
>I want to get this kind of output from a sql statement,
>
>select start,end from counter
>
>in counter.dbf it had this data
>
>start end
>1 5
>6 7
>8 10
>
>but what i want is to add a column block with continious numbers.
>
>block start end
>1 1 5
>2 6 7
>3 8 10
>
>Thanxs for any input
I don't have VFP right now to test, but perhaps you can use two SELECT statements, and recno(), thusly:
select start, end from MyTable;
order by ...;
sort by ...;
into cursor Temp1
select *, recno() from Temp1 into cursor Temp2
If you have a UDF to generate sequential numbers, you could also call that function as part of the SELECT statement. You would have to reset the sequence though, if you use the SELECT statement more than once.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)