Information générale
Catégorie:
Codage, syntaxe et commandes
>when I try to take the val(c_id) it won't allow me to select anything in my combobox(shows the names but won't let me select). If I tru allt(val(c_id) i get an error.
You need to make the value a string again before doing the ALLTRIM(): ALLTRIM(STR(VAL(c_id)))
Beware that if you do this in a SELECT statement, you should make sure that the result string is long enough to contain the largest number, or you may get truncated values. If so, you could use PADR(ALLTRIM(STR(VAL(c_id))), MAX_LEN) to get a left aligned value, or STR(VAL(c_id), MAX_LEN) to get a right aligned value (MAX_LEN beeing the field size or the length of the longest number).
If speed is important, you should experiment with TRANSFORM(...) instead of ALLTRIM(STR(...)) and LEFT(TRANSFORM(...) + lcString_With_MAX_LEN_Spaces, MAX_LEN) instead of PADR(...) to find out what is fastest.
Arne
Précédent
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