Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can this be done in a view??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00854846
Message ID:
00855050
Vues:
20
This message has been marked as the solution to the initial question of the thread.
Victor,
You may be able to do this using the $ operator and adding a couple of delimiters around the field value.
lcEmployeeString = "*12*,*35*"
SELECT *;
   FROM audits Audits;
   WHERE '*' + transform(Audits.employee_id) + '*' $ ?lcEmployeeString
HTH.

>>You're trying to compare an integer to a string. You can do
>>
>>WHERE employee_id = 12 or employee_id = 35
>>
>>or
>>
>>WHERE TRIM(STR(employee_id)) IN ("12", "35")
>>
>>You can't do the = because VFP will look for the employee_id "12,35", not 12 or 35
>
>
>Right....but my real problem is that the ("12","35") itself needs to be a variable....
>
>
>>
>>>employee_id field is Integer...
>>>
>>>This works:
>>>
>>>SELECT * from audits WHERE employee_id in (12,35)
>>>
>>>
>>>This doesn't:
>>>
>>>lcEmployeeString = '12,35'
>>>
>>>SELECT *;
>>> FROM audits Audits;
>>> WHERE ALLTRIM(STR(Audits.employee_id)) IN (?lcEmployeeString)
>>>
>>>
>>>I also tried this:
>>>lcEmployeeString = "'12','35'"
>>>lcEmployeeString = '12,35'
>>>lcEmployeeString = "('12','35')"
>>>
>>>Can I even do this in a remote view?
>>>
>>>Thanks!
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform