Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Mustapha Bihmouten
  Where is Mustapha Bihmouten?
 Casablanca
 Morocco
 Mustapha Bihmouten
 Tags
Subject: RE: Instead of
Thread ID: 289393 Message ID: 289403 # Views: 27 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Friday, December 31, 2010 3:09:05 PM         
   


> > hi all,
> >
> > i try to use thisform.text6.value and thisform.text7.value Instead of '2005','2006'
> > ...etc not works
> >
> > ** at combo1 value (2005,2006),(2006,2007),(2007,2008),(2008,2009)......etc
> > thisform.text1.Value=this.value
> > thisform.text6.Value=SUBSTR(thisform.text1.Value,1,4)
> > thisform.text7.Value=SUBSTR(thisform.text1.Value,6,4)
> > thisform.text8.Value=val(thisform.text7.Value)+1
> > thisform.text9.Value=val(thisform.text7.Value)+2
> > thisform.text10.Value=val(thisform.text7.Value)+3
> > 

> >
> > Select column5, column6,;
> >   CAST(Icase(;
> >   column7 >= thisform.text6.value And column7 <= thisform.text7.value,(thisform.text1.value), ;
> >   column7) As c(10)) As 'column7', ;
> >   count(column5) As total_cfil ;
> >   from test ;
> >   WHERE column6 In ('ÃÝÑÇÏ      ','ÔÑßÉ ãÓÇåãÉ','ÔÑßÉ ÚÇÏíÉ ') And Val(column7) In ((thisform.text6.value),(thisform.text7.value),(thisform.text8.value),(thisform.text9.value),(thisform.text10.value)) ;
> >   group By 1, 2, 3 ;
> >   INTO table mucurt
> > 

> > **********************************************
> > ***********this code works
> >
> > Select column5, column6,;
> >   CAST(Icase(;
> >   column7 >= '2005' And column7 <= '2006','2005,2006', ;
> >   column7) As c(10)) As 'column7', ;
> >   count(column5) As total_cfil ;
> >   from test ;
> >   WHERE column6 In ('ÃÝÑÇÏ      ','ÔÑßÉ ãÓÇåãÉ','ÔÑßÉ ÚÇÏíÉ ') And Val(column7) In (2005,2006,2007,2008,2009) ;
> >   group By 1, 2, 3 ;
> >   INTO table mucurt
> >  
> >   

> > thanks
>
> Hello Mohammed
>
> when you extract the year :
thisform.text6.Value=SUBSTR(thisform.text1.Value,1,4)
the result is numeric
>
> you have to convert in to string with Str() :
thisform.text6.Value=Str( SubStr(thisform.text1.Value,1,4), 4,0)

>
>
> Regards
> Mustapha Bihmouten

SUBSTR() returns a string, even if the string consists of digits.

-Anders

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