FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with date - I not understood
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with date - I not understood
Posted: Sun Jun 20, 2021 02: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




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



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 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
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Problem with date - I not understood
Posted: Sun Jun 20, 2021 03: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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with date - I not understood
Posted: Sun Jun 20, 2021 04: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 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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with date - I not understood
Posted: Sun Jun 20, 2021 04: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 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
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Problem with date - I not understood
Posted: Sun Jun 20, 2021 09: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.08 with Harbour

Continue the discussion