multiplying two fields

baranovitch

New member
Local time
Today, 19:15
Joined
May 16, 2007
Messages
7
hey, i would like to see in the room price column, the total price payed for the room judging by the loyalty(no of nights). So basically i want the loyalty(no of nights X roomprice. At the moment, when i run the query it in the room price it shows just the one night price, but i want to X that by how many nights the person has stayed. I have tryed putting the sum function in the roomprice field and it didnt work.

Thanks.
 

Attachments

  • untitled88.JPG
    untitled88.JPG
    66.1 KB · Views: 1,108
  • untitled89.JPG
    untitled89.JPG
    82.5 KB · Views: 736
If you don't use criteria for Total Price, you can simply multiply the Loyalty by RoomPrice in a new column in the query grid and choose Expression in the Total: row.

Total Price: CCur([Loyalty (no of nights)]*[RoomPrice])


However, if you may later need to use Criteria for this Total Price column, you can't use the alias for loyalty. You have to repeat the expression for its calculation, i.e.

Total Price: CCur(ExpressionForCalculatingLoyalty(no of nights)*[RoomPrice])


The CCur() function converts the results into currency.

^
 

Users who are viewing this thread

Back
Top Bottom