Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple SQL
Message
From
13/02/2003 17:00:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00752908
Message ID:
00752934
Views:
13
I like this, because of its simplicity.

However, I think it will need a small adjustment, to avoid the field being too small (because of the initial 0). Also, an AS clause is appropriate. Something like SELECT Inc(@lnCounter) + 00000 AS IncCount.

Note: I don't have VFP available to test right now.

>Try with this:
>
>
>lnCounter=0
>SELECT Inc(@lnCounter), Start, End from Counter
>FUNCTION Inc(tnIncremental)
>tnIncremental = tnIncremental + 1
>RETURN (tnIncremental-1)
>
>
>>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
>
>
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform