🔒 Closed PHP coders and MySQL

Status
Not open for further replies.

PHC-SUIYOBI

Eternal Poster
Good day po sa inyo, ask lang po kung paano i-multiply yung result ng DATEDIFF sa price ng room po?
bali yung PricePerNight is na sa roomcharges table and yung nakapaloob sa DATEDIFF is na sa rentals na table.
Nacalculate naman niya kung ilang days yung na spend ng bawat customer, bali gusto ko po sana i multiply yung result sa DATEDIFF tsaka yung sa corresponding room na inaccommodate ni customer.
Ito po ang SQL statement ko:
SQL:
SELECT customers.LastName, customers.FirstName, customers.PermanentAddress, rentals.DateIn,
DATEDIFF(DateOut, DateIn) AS Days
FROM customers
INNER JOIN rentals ON customers.CustomerID = rentals.CustomerID
ORDER BY Days DESC;

and ito yung Result ng SQL statement ko po,
1648557508202.webp


And yung Days po sana jan gusto ko po sana imultiply dito sa table na ito:
1648557582762.webp


provide ko na din po yung database ko po at nang mai-try niyo po mismo ng inyo nang maintindihan niyo po and punto ko.
Baka po may makatulong jan. Maraming Salamat po.
 
Status
Not open for further replies.

About this Thread

  • 5
    Replies
  • 725
    Views
  • 4
    Participants
Last reply from:
dev-ace

Trending Topics

Online now

Members online
349
Guests online
1,096
Total visitors
1,445

Forum statistics

Threads
2,273,588
Posts
28,950,471
Members
1,235,846
Latest member
viscahm16
Back
Top