Quote from: Fredrick Ughimi on September 05, 2019, 03:57:53 pmHello,
I am stump trying to figure out how to automatically 'trigger' this sequence of SQL startements. I wonder if Trigger is the best condidate.
But triggers are only triggered when an INSERT, DELETE or UPDATE occurs. I want the statements triggered when this conditions are met:
If (sDepartureDate < Date$) Or (sDepartureDate = Date$ And Time$ > "12") Then
Any help would be appreciated.
Quote from: cj on July 21, 2019, 11:15:22 am2. Is this to add a time stamp to
Every insert (unlikely)
Create a table logging all entries?
Create a flat file text log on disk?
3. This is for the server, right?
Quote from: Fim on October 16, 2019, 01:02:33 pm... how to get it from the server?
Quote from: Fredrick Ughimi on July 20, 2019, 08:13:27 pm...
What is the difference SQLiteningProcsA and SQLiteningProcsB?
WITH Bills(Name,TotalBill) AS (SELECT Surname, Total(Amount) + Total( Quantity * SellingPrice - Discount)
LEFT OUTER JOIN tblPharmacyBill ON tblServicesBill.Surname = tblPharmacyBill.Surname
GROUP BY Surname
SELECT Name FROM Bills
LEFT OUTER JOIN tblPayments ON Bills.Name = tblPayments.Surname
WHERE TotalBill > Total( tblPayments.Amount)
GROUP BY Surname
TotalBill = ServicesBill (Amount) + tblPharmacyBill (Quantity*SellingPrice-Discount)
If TotalBill > Payments (Amount) then
? "Patient is a debtor"
? "Patient not a debtor"
slExe "Create Table If Not Exists tblServicesBill(Date TEXT, BillNo TEXT, HospitalNo TEXT COLLATE NOCASE, Surname TEXT, Othernames TEXT, Category TEXT," & _
"Department TEXT, CodeNo TEXT COLLATE NOCASE, Service TEXT, Amount REAL, Discount REAL, Status TEXT)"
slExe Build$("Create Table If Not Exists tblPharmacyBill(RecNo TEXT, SNo TEXT, Date TEXT, InvoiceNo TEXT, HospitalNo TEXT, Name TEXT,", _
"ProductNo TEXT COLLATE NOCASE, Description TEXT, PatientCategory TEXT, Department TEXT, Quantity INTEGER, SellingPrice REAL, Discount REAL, Username TEXT)")
slExe Build$("Create Table If Not Exists tblPayments(ReceiptNo INTEGER, BillNo INTEGER, Date TEXT, HospitalNo TEXT, Surname TEXT, Othernames TEXT,", _
"Category TEXT, Stage TEXT, PaymentMode TEXT, CheckNo TEXT, Amount REAL, Purpose TEXT, Department TEXT, Cashier TEXT)")