Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select 'String is to long to fit' error message
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Select 'String is to long to fit' error message
Divers
Thread ID:
00820076
Message ID:
00820076
Vues:
65
Hi All,

I'd like to use a multiple iif in a select statement but am getting a error message "String is too long to fit".

The below sample shows the syntax.

If I can get it to work, I will be adding a few more fields to the select, but I'm starting off with just this one field.

***************************************************
SELECT ;
IIF(rx <> " " and location = " ",trim(name) + " " + trim(detail) + " Rx- " + trim(rx), ;
IIF(rx <> " " and location <> " ",trim(name) + " (" + trim(location) + ") " + trim(detail) + " Rx- " + trim(rx), ;
IIF(rx = " " and location <> " ",trim(name) + " (" + trim(location) + ") " + trim(detail), ;
IIF(rx = " " and location = " ",trim(name) + " " + trim(detail),' ')))) as mdetail from hshealth
***************************************************

p.s.
I tried breaking it up storing sections to variables, but get the same error message.

Using variables:
mselone = " SELECT IIF(rx <> ' ' and location = ' ',trim(name) + ' ' + trim(detail) + ' Rx- ' + trim(rx), "
mseltwo = " IIF(rx <> ' ' and location <> ' ',trim(name) + ' (' + trim(location) + ') ' + trim(detail) + ' Rx- ' + trim(rx), "
mselthree = " IIF(rx = ' ' and location <> ' ',trim(name) + ' (' + trim(location) + ') ' + trim(detail), "
mselfour = " IIF(rx = ' ' and location = ' ',trim(name) + ' ' + trim(detail),' ')))) as mdetail from hshealth "

then:
&mselone + &mseltwo + &mselthree + &mselfour

Am I way off base trying to use this method?

Thanks,
Jim Harvey
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform