Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select to String variable possible?
Message
From
27/01/2005 19:20:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981569
Message ID:
00981571
Views:
33
>I have a cursor as follows:
>
>field1  field2
>a       .t.
>b       .f.
>c       .t.
>d       .f.
>e       .t.
>
>
>I would like to select field1 where field2 is .t. then store the selected field1 values in one string. In this example, the string would be "ace". My question is: is it possible to issue just one SQL-Select statement to achieve what I want? If so, please advise.

I don't think so. With GROUP BY you can combine results from several records in a group, including sums, but I don't think that string concatenation is possible. I suggest you write UDF, which you then invoke from the query.
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