Problem with Filter and Tdatabase

Problem with Filter and Tdatabase

Postby Silvio.Falconi » Wed Nov 06, 2024 12:38 pm

Please I have this function

Code: Select all  Expand view
#include "fivewin.ch"

request dbfcdx

Function test
     local oDbf
     local cdbfPath:= cFilePath(GetModuleFileName( GetInstance() ))  + "Data\"
     local nYear:= year(date())
     local   cFilter:= "
LTRIM(STR(YEAR(FIELD->DATA)))= '" + ltrim(str(nyear)) + "'"
   

  oDbf:= TDatabase():Open( , cdbfPath+"
LOTTO", "DBFCDX", .T. )
  oDbf:setorder(1)
  oDbf:GoTop()

          xbrowser odbf

        oDbf:SetFilter(cFilter)
        oDbf:GoTop()

     xbrowser odbf
return nil


the index 1 is on DTOS(DATA)+CONCORSO

before the filter I see all archive

Image

the filter seems good

Image

After the filter it not show any records , why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with Filter and Tdatabase

Postby MarcoBoschi » Wed Nov 06, 2024 1:25 pm

Silvio,
have you some records in which the year of field named "data" is 2024
In the screenshot I see 1971

Bye
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Problem with Filter and Tdatabase

Postby Silvio.Falconi » Wed Nov 06, 2024 1:29 pm

MarcoBoschi wrote:Silvio,
have you some records in which the year of field named "data" is 2024
In the screenshot I see 1971

Bye


yes that is the beginning of the archive, I tried to make a filter in emagdbu


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with Filter and Tdatabase

Postby Silvio.Falconi » Wed Nov 06, 2024 8:42 pm

It's strange because in the test I did, that is, in the procedure in a small dialog, everything works perfectly, but when I create an object class with all the functions of the procedure it doesn't work, that is, it doesn't find the data, there's definitely an error somewhere that I can't find.

this is basically what i'm doing, it seems complex but it's not

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests