Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mustapha Bihmouten
  Where is Mustapha Bihmouten?
 Casablanca
 Morocco
 Mustapha Bihmouten
 To: mohammed qasem
  Where is mohammed qasem?
 amman
 Jordan
 mohammed qasem
 Tags
Subject: RE: Instead of
Thread ID: 289393 Message ID: 289407 # Views: 23 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Friday, December 31, 2010 3:53:36 PM         
   


> thank you,
> error message Alias text6 is not found
> Select column5, column6,;
> CAST(Icase(;
> column7 >= val(thisform.text6.value) And column7 <= val(thisform.text6.value),val(thisform.text1.value), ;
> .....
>

if you want to keep your column7 as character c(10) don't use val() in the select clause

Select column5, column6,;
CAST(Icase(;
column7 >= val(thisform.text6.value) And column7 <= val(thisform.text6.value),val(thisform.text1.value), ;


use val()only in the where clause : And Val(column7) In (val( thisform.text6.value),val( thisform.text7.value), ...


you may store all textbox.value in local variables before your select
you gain better readability

*--- declare the vars and their types
local lcText1Val as string, lcText6Val as string, lcText7Val as string, ;
  liText8Val as integer,  liText9Val as integer,  liText10Val as integer

*--- assign value to variables
m.lcText1Val  = This.Value
m.lcText6Val  = SUBSTR( m.lcText1Val, 1, 4)
m.lcText7Val  = SUBSTR( m.lcText1Val, 6, 4)
m.liText8Val  = val( m.lcText7Val) +1
m.liText9Val  = val( m.lcText7Val) +2
m.liText10Val = val( m.lcText7Val) +3

*--- assign vars to the textboxes
With Thisform
 .text1.value  = m.lcText1Val
 .text6.Value  = m.lcText6Val
 .text7.Value  = m.lcText7Val
 .text8.Value  = m.liText8Val
 .text9.Value  = m.liText9Val
 .text10.Value = m.liText10Val
Endwith

*--- run the query
Select column5, column6,;
  CAST(Icase( ;
  column7 >= m.lcText6Val And column7 <= m.lcText7Val, m.lcText1Val, column7) As c(10)) As 'column7', ;
  count(column5) As total_cfil ;
  from test ;
  WHERE column6 In ('ÃÝÑÇÏ      ','ÔÑßÉ ãÓÇåãÉ','ÔÑßÉ ÚÇÏíÉ ') ;
  And Val(column7) In ( val( m.lcText6Val), val( m.lcText7Val), m.liText8Val, m.liText9Val, m.liText10Val)
  group By 1, 2, 3 ;
  INTO table mucurt

Regards
Mustapha Bihmouten

ENTIRE THREAD

Instead of Posted by mohammed qasem @ 12/31/2010 1:28:29 PM
RE: Instead of Posted by Mustapha Bihmouten @ 12/31/2010 2:00:56 PM
RE: Instead of Posted by mohammed qasem @ 12/31/2010 2:24:44 PM
RE: Instead of Posted by Mustapha Bihmouten @ 12/31/2010 2:58:47 PM
RE: Instead of Posted by mohammed qasem @ 12/31/2010 3:10:12 PM
RE: Instead of Posted by Mustapha Bihmouten @ 12/31/2010 3:53:36 PM
RE: Instead of Posted by mohammed qasem @ 12/31/2010 4:19:45 PM
RE: Instead of Posted by Anders Altberg @ 12/31/2010 3:09:05 PM
RE: Instead of Posted by Mustapha Bihmouten @ 12/31/2010 3:17:16 PM