Hi, I have this issue:
I have two excel tables that I linked in access. From excel tables I created query that gives me all data I need.
First table has data of periods and prices of apartment per period. For example:
PropertyID 1111
PropertyName Apartment Zagreb Mila
StaringDateOfPeriod 1.1.2015
EndingDateOfPeriod 1.7.2015
PriceForPeriod 100
.
.
PropertyID 1111
PropertyName Apartment Zagreb Mila
StaringDateOfPeriod 1.7.2015
EndingDateOfPeriod 31.12.2015
PriceForPeriod 120
Now as you can see I have apartments with prices that change per periods.
Second excel table gives me informations of total paid service that customers need to pay , number of days that he will stay and CheckIn and CheckOut dates of those guest.
In calclutated fields in query I created calculations like TotalyPiad(from 2. table) - OwnerPrice*TotalyNumberofDays . I guest good result IF i have reservations that matches or is it BETWEEN StartDate and EndDate of periods.
BUT If I have reservation that is overlaping , where CheckOut of guest is 1 or more days > that EndDate of selected period I have problem with calculation because my calculation is based on WRONG price in that period.
For now what I manage to do is to create separate field in query where I calculated number of days that are out of range
CHECK_IN - StartingDate of period
CHECK_OUT -EndingDate of period
Check-in date - starting date of reservation of guest
Check-out date - ending date of guests reservation
nabavna cijena - owner price
But still when I calculate those number of days I multiple those number of days with old period.
So HOW CAN I MULTIPLE THOSE NUMBER OF DAYS WITH PERIOD +1 , I meen next period not this old one just for those days that are out of range? [CHECK_OUT] +1 doesn't help it just add extra day in my CHECK_OUT filed
My final idea is : separately calculate in one field number of days that are out site of range
Calculate number of days of reservation of guest that are in range
= make sum of those two fields
From that I will create report which I will send to our owners of properties (number of reservations, reservations details, price that they need to pay to us ...)
I also thought this could be possible to make using VBA but I am still not skilled anough in it. Also I was thinking of creating calendar where I would that add those two queries but I do not have idea how to create simple calendar in Access. Is there some template for simple calendar in Access?
I really appreciate any help
Thank you!
I have two excel tables that I linked in access. From excel tables I created query that gives me all data I need.
First table has data of periods and prices of apartment per period. For example:
PropertyID 1111
PropertyName Apartment Zagreb Mila
StaringDateOfPeriod 1.1.2015
EndingDateOfPeriod 1.7.2015
PriceForPeriod 100
.
.
PropertyID 1111
PropertyName Apartment Zagreb Mila
StaringDateOfPeriod 1.7.2015
EndingDateOfPeriod 31.12.2015
PriceForPeriod 120
Now as you can see I have apartments with prices that change per periods.
Second excel table gives me informations of total paid service that customers need to pay , number of days that he will stay and CheckIn and CheckOut dates of those guest.
In calclutated fields in query I created calculations like TotalyPiad(from 2. table) - OwnerPrice*TotalyNumberofDays . I guest good result IF i have reservations that matches or is it BETWEEN StartDate and EndDate of periods.
BUT If I have reservation that is overlaping , where CheckOut of guest is 1 or more days > that EndDate of selected period I have problem with calculation because my calculation is based on WRONG price in that period.
For now what I manage to do is to create separate field in query where I calculated number of days that are out of range
CHECK_IN - StartingDate of period
CHECK_OUT -EndingDate of period
Check-in date - starting date of reservation of guest
Check-out date - ending date of guests reservation
nabavna cijena - owner price
Code:
PreklapanjePerioda: IIf([Check-out date]>[CHECK_OUT];[Check-out date]-[CHECK_OUT];Null)*[nabavna cijena]
So HOW CAN I MULTIPLE THOSE NUMBER OF DAYS WITH PERIOD +1 , I meen next period not this old one just for those days that are out of range? [CHECK_OUT] +1 doesn't help it just add extra day in my CHECK_OUT filed
My final idea is : separately calculate in one field number of days that are out site of range
Calculate number of days of reservation of guest that are in range
= make sum of those two fields
From that I will create report which I will send to our owners of properties (number of reservations, reservations details, price that they need to pay to us ...)
I also thought this could be possible to make using VBA but I am still not skilled anough in it. Also I was thinking of creating calendar where I would that add those two queries but I do not have idea how to create simple calendar in Access. Is there some template for simple calendar in Access?
I really appreciate any help
Thank you!