Sample Header Ad - 728x90

Using sum and datediff from 2 tables

-2 votes
1 answer
64 views
I am using 2 tables Members (MemberID, MemberName, Department, JoinDate, LeaveDate) Subscriptions (ID, MemberName, DatePaid, AmountPaid) I have combined them SELECT Members.MemberID, Members.MemberName, Members.Department, Members.JoinDate, Members.LeaveDate, Subscriptions.MemberName, Subscriptions.DatePaid FROM Subscriptions LEFT JOIN Members ON Subscriptions.MemberName = Members.MemberName I am trying to add a column to calculate the number of weeks - DateDiff(JoinDate,CurDate()) as Weeks and also Sum(Subscriptions.AmountPaid) Can do individual, but want in same table myphpadmin -Database client version: libmysql - mysqlnd 8.2.11PHP extension: mysqli Documentation curl Documentation mbstring Documentation sodium Documentation PHP version: 8.2.11 –
Asked by Mark V (9 rep)
Oct 16, 2023, 07:52 AM
Last activity: Oct 16, 2023, 12:46 PM