I must make a count of number of record there are on dbf
and I make an filter with some paramters
sample : I check if field month(DATA) is the selected
It not make error of Invalid filter but not execute the filter why ?
I tried with Month(FIELD->data) and Month(data) but not execute the filter
Any solution pls
and I make an filter with some paramters
sample : I check if field month(DATA) is the selected
It not make error of Invalid filter but not execute the filter why ?
#include "fivewin.ch"
FUNCTION Main()
RddSetDefault( "DBFCDX" )
SetHandleCount( 100 )
SET DATE FORMAT "dd-mm-yyyy"
SET DELETED ON
SET CENTURY ON
SET EPOCH TO year( date() ) - 20
SET MULTIPLE OFF
testfilter ()
RETURN nil
Function testfilter()
local aContMesi:= {.f.,.F.,.f.,.f.,.f.,.f.,.f.,.f.,.f.,.t.,.t.,.t.}
local cFilter:='"'
local oConteggio
// mesi
If aContmesi[1]=.t.
nMese:=1
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[2]=.t.
nMese:=2
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[3]=.t.
nMese:=3
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[4]=.t.
nMese:=4
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[5]=.t.
nMese:=5
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[6]=.t.
nMese:=6
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[1]=.t.
nMese:=1
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[7]=.t.
nMese:=7
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[8]=.t.
nMese:=8
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[9]=.t.
nMese:=9
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[10]=.t.
nMese:=10
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[11]=.t.
nMese:=11
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
cFilter += " .and. "
Endif
If aContmesi[12]=.t.
nMese:=12
cFilter += " Month(FIELD->data) =='"+alltrim(str(nMese))+"'"
Endif
cFilter+= '"'
?cFilter
oConteggio:=TDatabase():Open( , "Lotto", "DBFCDX", .T. )
oConteggio:setorder(1)
oConteggio:setFilter(cFilter)
oConteggio:gotop()
// xbrowser oConteggio
nRecords:=oConteggio:Reccount()
oConteggio:close()
msginfo(nrecords)
return nilI tried with Month(FIELD->data) and Month(data) but not execute the filter
Any solution pls
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 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
I use : FiveWin for Harbour March-April 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
