updating an archive
Posted: Mon Nov 14, 2022 12:31 pm
I have to update a archive on each Tuesday, Thursday, Saturday
I check the database and check if today is major of date of last record of archive
I not understood why it return me allways false
even if for example the date of the last record is equal to the number of today's day
example
archive date 12.11.2022 nday 6
date today saturday nday 6
How I can resolve ?
I check the database and check if today is major of date of last record of archive
I not understood why it return me allways false
even if for example the date of the last record is equal to the number of today's day
example
archive date 12.11.2022 nday 6
date today saturday nday 6
How I can resolve ?
- Code: Select all Expand view
- Function CheckEstrazione()
local oDbf
local dDataEstrazione
local lOld:=.t.
local oTimer
local nTuesday: = 2
Local nThursday: = 4
local nSaturday: = 6
local nDayarchive,nDaytoday
oDbf:= TDatabase():Open( , "LOTTO", "DBFCDX", .T. )
oDbf:setorder(1) //data
oDbf:GoBottom()
dDataEstrazione:= oDbf:data
oDbf:close()
nDayarchive := DOW((dDataEstrazione)-1)
nDaytoday := DOW( date() -1 )
IF nDaytoday = nTuesday
lOld:=.t.
IF nDayarchive < nDayToday
lOld:=.f.
Endif
Endif
IF nDaytoday = nThursday
lOld:=.t.
IF nDayarchive < nDayToday
lOld:=.f.
Endif
Endif
IF nDaytoday = nSaturday
lOld:=.t.
IF nDayarchive < nDayToday
lOld:=.f.
Endif
Endif
? lOld
return lOld