Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select command
Message
De
04/02/2013 14:31:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01565071
Message ID:
01565096
Vues:
43
I assume that you Select from a dbf? Try
Select chrtran(prog_long,","," ") as prog_long, COUNT(*) AS Quant FROM reembolso GROUP BY 1  where reembolso.date > DATE()-thisform.days.value  INTO CURSOR crsReemb ORDER BY quant DESC
>Thank you Tore
>
>It makes sense, however:
>
>SELECT prog_long works fine, but SELECT chrtran(prog_long,",","") result error message "variable prog_long not found"
>
>Do you think a select command does not accept so many instructions ?
>
>Moises
>
>
>
>>chrtran(prog_long,",","")
>>
>>>Tore
>>>
>>>thisform.days.value is working
>>>
>>>The variable not found is prog_long if treated with GETWORDNUM()
>>>
>>>I am just trying to remove the comma from prog_long as suggest by Rich.
>>>
>>>It there another way to do it inside the select command ?
>>>
>>>Moises
>>>
>>>
>>>
>>>
>>>>Replace thisform.days.value with a variable.
>>>>
>>>>>Hi Rich
>>>>>
>>>>>I replaced it as you said:
>>>>>
>>>>>SELECT GETWORDNUM(Prog_long,1,",") , COUNT(*) AS Quant FROM reembolso GROUP BY prog_long where reembolso.date > DATE()-thisform.days.value INTO CURSOR crsReemb ORDER BY quant DESC
>>>>>
>>>>>But I got the error message "variable not found".
>>>>>
>>>>>It seems the command is not accepted in a line, or am I doing something wrong ?
>>>>>
>>>>>Moises
>>>>>
>>>>>
>>>>>>>I am using the code below to group results,but the problem is that some records have a comma which duplicates some results
>>>>>>>
>>>>>>>eg:
>>>>>>>
>>>>>>>Yellow
>>>>>>>blue
>>>>>>>blue,
>>>>>>>green
>>>>>>>red
>>>>>>>red,
>>>>>>>
>>>>>>>Is there a way to remove the comma only from the the result of the code below without removing the commas from the original table ?
>>>>>>>
>>>>>>>
>>>>>>>SELECT Prog_long , COUNT(*) AS Quant FROM reembolso GROUP BY prog_long where reembolso.date > DATE()-thisform.days.value INTO CURSOR crsReemb ORDER BY quant DESC
>>>>>>
>>>>>>Try......
>>>>>>
GETWORDNUM(myfield,1,",")
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform