I must check if a room is free or not for a a range date
I made a test
the test always returns me false with either
local ddcheckin: = ctod ("07/31/2020")
local ddcheckout: = ctod ("07/31/2020")
and be with
local ddcheckin: = ctod ("02/07/2020")
local ddcheckout: = ctod ("02/07/2020")
but in reality only the first date range the room is not free for the second date range the room is free
how can i solve?
I made a test
#include "Fivewin.ch"
request dbfcdx
request dbffpt
Function test()
*local ddcheckin := ctod("31/07/2020")
*local ddcheckout := ctod("31/07/2020")
local ddcheckin := ctod("02/07/2020")
local ddcheckout := ctod("02/07/2020")
local number := 2
local cDesc :="Om"
local cTipo :="01"
local cRoom := Left( cDesc,1)+Strzero(number,3)
local lFree :=.f.
local oReservation
RddSetDefault( "DBFCDX" )
oReservation:=TDatabase():Open( , "Reserva", "DBFCDX", .T. )
oReservation:setorder(1)
oReservation:gotop()
lFree := Search_Room(cRoom,ddcheckin,ddcheckout,oReservation)
? lFree
RETURN NIL
//--------------------------------------------------------------------------//
Function Search_Room(cRoom,ddcheckin,ddcheckout,oReservation)
local lFound:=.f.
Local cSeekT := (cRoom) + dtos(ddcheckin)
oReservation:seek( cSeekT )
WHILE !oReservation:eof()
lFound := .t.
oReservation:skip()
ENDDO
RETURN lFound
//--------------------------------------------------------------------------//the test always returns me false with either
local ddcheckin: = ctod ("07/31/2020")
local ddcheckout: = ctod ("07/31/2020")
and be with
local ddcheckin: = ctod ("02/07/2020")
local ddcheckout: = ctod ("02/07/2020")
but in reality only the first date range the room is not free for the second date range the room is free
how can i solve?
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