I´m training to be a SQL Server user and I have a question if I have to create a procedure in this case and how create it. I wrote a query where I can show the revenue capacity for a specific month if I booked every rooms in the hotel. And I wrote another query where I can show the total revenue for the booked rooms for the same specific month.
So with these datas, now I have to show if the hotel had loss and profit. Please, someone could help me?
/* Revenue capacity for August 06 */
SELECT sum(Vl_price * 31) Revenue_capacity_August06
FROM Room
WHERE Nr_hotel = '1'
group by Nr_hotel
/* Total Revenue for August06 */
SELECT sum(DATEDIFF (DAY,Dt_start,Dt_end) * Vl_price) Revenue
FROM Booked B
inner join Room R
ON B.Nr_room = R.Nr_room
WHERE R.Nr_hotel = '1' and Dt_start between '2006/08/01' and '2006/08/31'
I have to show if this specific hotel had loss or profit in the specific period.
I’ve been tasked with creating an absence tracker that will monitor holidays and sickness - I have created the basic layout and a key which determines holiday = H half day morning =Hd1 absence = A etc ...
So the premise is obviously if employee 1 is on holiday you would enter H in the relevant date cell, off sock you would enter A.
What I’m struggling with is the correct formula to add them up each month so absence will be separate and not so much of an issue, but say they have Monday on holiday, and Tuesday as a morning on holiday and then they’re off on compassionate leave on Friday at the end of the month there would be 3 days authorised leave, I’m confused how I put that in a formula.
Try something like this, using countif formula:
=countif(D$6:D$34,$C2)
My solution is available here:
https://docs.google.com/spreadsheets/d/1_oCCsuvseJUqrjWgjDKesON9CSFLZTXxQvYAG8T5Cwk/copy
I have to pay a commission to Agents (affiliates) based on the following conditions:
the commission starts on a monthly basis following a USER (linked to the Agent) first deposit/purchase on a website
agents have a decreasing commission, ex: 1 month following first deposit of their USER = 30% of sales, 2d month period following 1st deposit of USER: 25% of sales, etc
Commission are paid on a month basis calculation (ex: from 01/07/2020 till 31/07/2020)
If a USER makes a first purchase on June 22d and if sales commission for 1st period is 30%, then agent is eligible to a 30% commission on sales from june 22d till July 22d, then 25% for sales from 23rd july till 23rd august, etc
I have designed a googlesheets (see below) that serves the purpose (using 12 columns to get the correct commission% for a specific user on a specific day!), but I am trying to find a more straight forward formula to get the applicable com. % based on the commission sliding table and the first deposit date of a specific user.
Can anyone help?
The google sheets showing my calc is here:
https://docs.google.com/spreadsheets/d/1I1gzZ670hJH8HwCGizzbvlQkg0dgAvgOSQTfOUL0VgU/edit?usp=sharing
This might help you. (Updated to correct the row number of where the formula should go.)
If you insert a new column in your sheet, to the right of Column W, the Current Commision Month, and paste the following formula in the cell where the Current Commision Month header text should appear (Row 9 in your sample) of that column, it replicates the results in your Current Commision Month.
But it does not require columns I through V. You can test that by deleting columns I through V - you can use Undo and Redo to go back and forth, if necessary. Depending on how you use your "End" column - the logic wasn't clear to me - the info for that can also be gained in this one column.
={"Current
Commision
Month";"";ArrayFormula(
if(
($H11:H<>"") * ($A11:A>=date(year(H11:H),month(H11:H),day(H11:H))),
ifs( $A11:A< date(year(H11:H),month(H11:H)+1,day(H11:H)),1,
$A11:A< date(year(H11:H),month(H11:H)+2,day(H11:H)),2,
$A11:A< date(year(H11:H),month(H11:H)+3,day(H11:H)),3,
$A11:A< date(year(H11:H),month(H11:H)+4,day(H11:H)),4,
$A11:A< date(year(H11:H),month(H11:H)+5,day(H11:H)),5,
$A11:A< date(year(H11:H),month(H11:H)+6,day(H11:H)),6,
$A11:A>=date(year(H11:H),month(H11:H)+7,day(H11:H)),9999),
""))}
The first IF test is to check that the FirstDeposit date is not blank, and that the sale date is greater than or equal to the FirstDeposit date.
The IFS tests go through and check whether the sale date is less than one of the months, and stops at the first value (commission month) that is greater than the sale date. If never, it places a vlaue of 9999.
Note that the "9999" values are just to indicate the sale date is greater than the "End" date, and can be changed to blanks or whatever you want.
[![enter image description here][1]][1]
I've added a sample tab with the final result. Let me know if this helps. There may be several other enhancements possible for your sheet, in particular the use of ARRAYFORMULAS to fill values down many of your columns.
I haven't spent time on the actual commision calculations, in the final columns, but if you feel that still needs improvements, I can try to simplify there as well.
[1]: https://i.stack.imgur.com/TfFZ5.png
I am a restaurant owner trying to automate the creation of a message to my employees using google spreadsheets.
I have this:
=E2&CHAR(10)&CHAR(10)&"Here are your tip numbers:"&CHAR(10)&CHAR(10)&"Cash Tips: "&I2&" Credit Card Tips: "&J2&" Form 4070's are due in the office by 4pm Wednesday and they are required by law from every tipped employee. Thank you. -- Management Team"
Here are the cell values:
E2 = "Ron"
I2 = "19"
J2 = "25"
Currently, it looks like this:
Ron
Here are your tip numbers:
Cash Tips 19 Credit Card Tips: 25 Form 4070's are due in the office by 4pm Wednesday and they are required by law from every tipped employee. Thank you. -- Management Team
But I would like it to be formatted like this:
Ron,
Here are your tip numbers:
Cash Tips: $19
Credit Card Tips: $25
Form 4070's are due in the office by 4pm Wednesday and they are required by law from every tipped employee.
Thank you.
-- Management Team
Can anyone help an old guy out who has zero experience doing this?
So, I am looking for:
A comma after "Ron"
"Cash Tips:" in BOLD letters
"Credit Card Tips:" in BOLD letters
A "$" sign before the number in the I2 and J2 fields
Lines skipped as noted above.
Partial formatting, for the bold, is unavailable at this time.
This takes care of the rest though:
=E2&","&CHAR(10)&CHAR(10)&"Here are your tip numbers:"&CHAR(10)&CHAR(10)&"Cash Tips: "&"$"&I2&CHAR(10)&CHAR(10)&"Credit Card Tips: "&"$"&J2&CHAR(10)&CHAR(10)&"Form 4070's are due in the office by 4pm Wednesday and they are required by law from every tipped employee."&CHAR(10)&CHAR(10)&"Thank you."&CHAR(10)&CHAR(10)&"-- Management Team"
Update to accommodate the rounding of currency values to 2 decimal places:
=E2&","&CHAR(10)&CHAR(10)&"Here are your tip numbers:"&CHAR(10)&CHAR(10)&"Cash Tips: "&"$"&ROUND(I2, 2)&CHAR(10)&CHAR(10)&"Credit Card Tips: "&"$"&ROUND(J2, 2)&CHAR(10)&CHAR(10)&"Form 4070's are due in the office by 4pm Wednesday and they are required by law from every tipped employee."&CHAR(10)&CHAR(10)&"Thank you."&CHAR(10)&CHAR(10)&"-- Management Team"
I am trying to add a sales receipt to QuickBooks POS using the SDK. I receive this error:
The receipt is not balanced.
Here is my XML:
http://pastebin.com/MweDDRqU
My order total with tax is 21.25. Here are my items:
2 Shoes at $10 each
6.25% MA Sales Tax added to shoes only
Shipping worth $5
Discount worth $5
Total is $21.25.
I am unsure why the system says I am off $9.37. Any ideas?
I don't know where it's getting $9.37 from, but it's true that your receipt is NOT balanced.
The total amount is $21.25, but you indicated you only received $20.00 in payment.
<TenderCheckAdd>
<CheckNumber>3</CheckNumber>
<TenderAmount>20.0000000000</TenderAmount>
</TenderCheckAdd>
This is akin to the person at the cash register telling you your total is $21.25, and you handing them a $20 bill and walking out the door.
You still owe them $1.25.