Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding quotes to a string
Message
De
31/10/2006 11:07:59
 
 
À
31/10/2006 11:01:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01165777
Message ID:
01165793
Vues:
14
>>>>Hi all, i'm implementing a dinamyc filter but i'm getting error in next case:
>>>>set filter to LINE_STATUS = 'INV' or LINE_STATUS = 'NQH' and (alltrim(UPPER(HOSPITAL)) == 'JFK')
>>>>I need to add quotes FOR -> (LINE_STATUS='INV' OR LINE_STATUS='NQH') to let filter works in this case. Some ideas?
>>>>T.I.A.
>>>
>>>lcFiltStat = "LINE_STATUS='INV' OR LINE_STATUS='NQH' and (alltrim(UPPER(HOSPITAL)) == 'JFK'"
>>>
>>>or
>>>
>>>lcFiltStat = [LINE_STATUS='INV' OR LINE_STATUS='NQH' and (alltrim(UPPER(HOSPITAL)) == 'JFK']
>>>
>>>Set filter to (lcFiltStat)
>>>
>>>or
>>>
>>>Set filter to &lcFiltStat
>>>
>>>I THINK!!!
>>>
>>>HTH
>>
>>Set filter to (somestring) will not work.
>
>Yes, I thought so but couldn't be arsed checking in my systems to find one. That's why I cited also:
>
>Set filter to &lcFiltStat
>
>I didn't just put that cos I'm sick of being jumped on by a UT member for using macro subs instead of named expressions. And waht happens instead? - I get jumped on for using a named expression. You just can't win! :-)

My intension was not to jump on you, if so I would have been much more sarcastic. :-) But I guess John Harold will be happy since he now can avoid spending time on something which will not work. Both these options will work
lcSelect='Select * from whatever for somecondition'
&lcSelect
lcFilter='for somecondition'
Select * from whatever &lcFilter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform