Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select
Message
From
07/08/2008 06:02:40
 
 
To
07/08/2008 05:46:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Select
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01336783
Message ID:
01337177
Views:
8
yes
but i need to use and not or

via or i get only one name,

if i insert at text1 your name as Tore and text2,text3 is epmty and text4 =Bleken
no result, i need to see your name at mygrid if any text empty or not

thank you

>Did you really try my code?
>
>>if text1=ali , text2=kaled,text3=sameer and text4=mohammed i get result
>>
>>if text1=(empty) , text2=kaled,text3=(empty) and text4=mohammed no result
>>
>>i need to fetch for what i have at texts not empty
>>
>>
>>>I don't understand your problem. Please explain by showing some samples of what you have and what you want.
>>>
>>>>hi ,
>>>>thank you for help and code i can use it for somthing else and i learn new thing,
>>>>
>>>>but i need to select the names from mytable as what i insert at the text1 to text 4,
>>>>
>>>>if any text is empty i need to fetch for text not epmty
>>>>if text1 not empty get all name as text1
>>>>
>>>>if text1 + text3 not empty get all names as text1+ text3
>>>>
>>>>if text2 +text4 not empty get all names as text2+ text4....etc
>>>>
>>>>i try as below but i must insert 4 texts to get the result if any text is empy no result,
>>>>
>>>>and i need to use AND not OR
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>             lcName = (thisform.text1.value)
>>>>             lcName1 = (thisform.text2.value)
>>>>             lcName2 = (thisform.text3.value)
>>>>             lcName3 = (thisform.text4.value)
>>>>
>>>>SELECT F4,F1,name4,name3,name2,name1  from x2 WHERE   (name1= lcName AND  name2= lcName1 and name3= lcName2 and name4=lcName3)  ;
>>>>into cursor crsMyCursor readwrite
>>>>
>>>>GO top
>>>>  thisform.Grid1.RecordSource="crsMyCursor"
>>>>          thisform.grid1.Visible=.t.
>>>>
>>>>
>>>>thank you very much
>>>>
>>>>
>>>>
>>>>>You want to select all records where any of the four names are in any of the four name fields, right?
>>>>>lcFromTable='x2'
>>>>>lcResultTable='crsMyCursor'
>>>>>For x=1 to 4
>>>>>   lcName=Evaluate('lcName'+Transform(x))
>>>>>   If !Empty(lcName)
>>>>>      Select whatever from (lcFromTable) where name1==lcName or name2==lcName or name3==lcName or name4==lcName into cursor (lcResultTable) READWRITE
>>>>>      lcFromTable=lcResultTable
>>>>>   EndIf
>>>>>EndIf
>>>>>
>>>>>>hi all,
>>>>>>
>>>>>>i use this code below to find names i need to rewrit it .
>>>>>>
>>>>>>thanks for help
>>>>>>
>>>>>>
>>>>>> SELECT F4,F1,name4,name3,name2,name1  from x2;
>>>>>>              where  (name1==lcName and name2==lcName1 and name3==lcName2 and name4==lcName3) OR ( name4==lcName3) ;
>>>>>>              ORDER by name1,name2,name3,name4;
>>>>>>               into cursor crsMyCursor readwrite
>>>>>>
>>>>>>    &&IF ! FOUND()  OR EMPTY
>>>>>>
>>>>>>SELECT F4,F1,name4,name3,name2,name1  from x2;
>>>>>>              where  ( name4==lcName3) ;  && shure found
>>>>>>              ORDER by name1,name2,name3,name4;
>>>>>>               into cursor crsMyCursor readwrite
>>>>>>
>>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform