Information générale
Catégorie:
Codage, syntaxe et commandes
>To all,
>
> I am issuing a select:
>
>SELECT nPrice, iLevel, iCount, ThisForm.GetFraction(iFraction) AS cFract, STR(iCount) + STR(iFraction) AS cSort FROM Pricing INTO CURSOR crsPrice WHERE Pricing.iPriceGpId = MenuItem.iPriceGpId ORDER BY cSort
>
> Everything works fine except that the return from the funtion only returns the first five characters, when actually the return is never shorter than 10 characters. All fields being selected are Integer fields except for the first one which is a N(8,2). I dumped the cursor out to a file and it indeed only has 5 characters in the structure. Any one know why this happens, and if it's for some odd reason "By design."
>
> Any help would be much appreciated.
>
>John Rowlinson
>Microworks POS Solutions
I would PADR both your cFract and cSort fields so that the same length is always returned. The SELECT will make the field size based off of the first record that is added to the cursor.
Dan
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement