Hi,
I have created a virtual table using the 'Add Command' when specifying a database.
The problem im having is that the data that is returned from the query is causing problems when calculating formula sum fields!!
The data is regarding a room that a guest can book and also the equipment that they order within that room.
A guest can order many rooms and also many pices of equipment withing each room.
Here is an example of the data that would be returned by the query the report is based on. The data the report is based on is all the bookings a SINGLE guest has made.
The roomcost is worked out using a formula field. RoomPrice/Night x LengthOfStay (LOS)
Equipment cost is worked out by multiplying the equipment price/day x LengthOfStay (LOS)
here is an example of the data the query will return for the bookings of a single guest:
RoomNo LOS RoomCost EquipBooking Cost
1 2 £10 x 2 VCR 8x2
1 2 £10 x 2 TV 10x4
1 2 £10 x 2 Trouser press 4x2
2 2 £20 x 2
The problem i have is that when i try and calculate the sum of the RoomCost i get a total of 100 (20+20+20+40) instaed of 60 (20 + 40).
It is counting the roomcost of room1 3 times!!!
How can i force the formula field to only count it once??
Can anyone plz help me?
I have created a virtual table using the 'Add Command' when specifying a database.
The problem im having is that the data that is returned from the query is causing problems when calculating formula sum fields!!
The data is regarding a room that a guest can book and also the equipment that they order within that room.
A guest can order many rooms and also many pices of equipment withing each room.
Here is an example of the data that would be returned by the query the report is based on. The data the report is based on is all the bookings a SINGLE guest has made.
The roomcost is worked out using a formula field. RoomPrice/Night x LengthOfStay (LOS)
Equipment cost is worked out by multiplying the equipment price/day x LengthOfStay (LOS)
here is an example of the data the query will return for the bookings of a single guest:
RoomNo LOS RoomCost EquipBooking Cost
1 2 £10 x 2 VCR 8x2
1 2 £10 x 2 TV 10x4
1 2 £10 x 2 Trouser press 4x2
2 2 £20 x 2
The problem i have is that when i try and calculate the sum of the RoomCost i get a total of 100 (20+20+20+40) instaed of 60 (20 + 40).
It is counting the roomcost of room1 3 times!!!
How can i force the formula field to only count it once??
Can anyone plz help me?