Problem with date - I not understood

Problem with date - I not understood

Postby Silvio.Falconi » Sun Jun 20, 2021 2:41 pm

I have a reservation from 20.06.2021 to 14.08.2021
in a procedure that I have broken down by the interval of the months and I calculate the days for each month
in this case the months of June, July and August are concerned

Image


to better understand the table that I present to you I will explain
in the first two columns there are the dates of the months: the month of June would start from the 15th because it is the 15th that is the date of the season
the calculation of days is calculated how many days in that period ie for example
from 15 June to 30 June the reservation interval (20.06 -14.08) is 11 days

the column 5 is a code that determines the type of season 02 is low 01 is high

you can observe in column 3 the total of the days
if you do a little math the total is 56


the customer insists that the days are actually 55 because he used the windows calculator you see below

Image

then if I go to do in fwh
nGiorni:=(dLast-dFirst) give me 55

what is the right calculation?

that is, I can't explain to the customer that the date range from 20.06 to 14.08 is 56 because the same 20.06 is also counted
while the microsoft windows calcculator makes the difference of the days between those dates by not counting the 20.06 day
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: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with date - I not understood

Postby Armando » Sun Jun 20, 2021 3:54 pm

Silvio:

I think that in the first case you are calculating "days" ie

From 2021-06-19 to 2021-06-20 are two days but
if you count "nights" it shoud be one night.

My five cents.

Regars
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3242
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Problem with date - I not understood

Postby Silvio.Falconi » Sun Jun 20, 2021 4:02 pm

Armando wrote:Silvio:

I think that in the first case you are calculating "days" ie

From 2021-06-19 to 2021-06-20 are two days but
if you count "nights" it shoud be one night.

My five cents.

Regars

here is a chalet and the owner sale umbrellas it is not as hotel where you calc only the nights
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: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with date - I not understood

Postby Silvio.Falconi » Sun Jun 20, 2021 4:39 pm

here we are talking about a different situation from hotels, the days are actually calculated for each day and not for the nights. If the interval has 55 nights, there are 56 days. For this reason, for example, I could not use the Tplan class because it manages nights like hotels and not single days. A bad thing about tplan is that it is poorly made for example you cannot manage one day just because it always runs from night of day to night of the next day.
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: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with date - I not understood

Postby Marc Venken » Sun Jun 20, 2021 9:18 pm

Silvio,

I would present the customer a extra column with the income for that periode of reservation. (just to make your point)
He will see that he will be losing 1 day of income and this will happen for every reservation period. (will become a lot of money)

If he still insists on having 1 day not calculated and giving it for free.... so be it. but you have done what is espected, giving him the option.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests