View Categories

How to fix the disordered sequence of Ticket# in the sales log report

< 1 min read

Table of Contents

This document will fix the sequence disorder of the sales log tickets


Procedure #

  1. Open a text document and copy paste the below script and save it with .sql extension (You can assign any name e.g. ticketorder.sql)
ALTER TABLE TICKETS ADD COLUMN DATENEW DATETIME;
UPDATE TICKETS T JOIN RECEIPTS R ON R.ID=T.ID SET T.DATENEW=R.DATENEW;
SET @row := 1;
SET @lastID := 1;
UPDATE TICKETS SET TICKETID =  @row := @row + 1 WHERE TICKETTYPE=0 AND TICKETID > @lastID ORDER BY DATENEW;
ALTER TABLE TICKETS DROP COLUMN DATENEW;

2. Now open the MySQL command prompt and log in using the password as password

3. Type use SALECULATOR; (Press Enter Key)

4. Type source C:\ticketorder.sql (Press Enter Key)

5. Type exit (Press Enter Key)

6. Now login to the Saleculator software and check the Sales Log to see if the ticket# sequence is in ascending order

0 Comments

Leave a Reply

Arrow-up