A
|
acpan 9/13/2021 |
You have not mentioned about the relation between the 2 tables. Assuming you are only interested in Reports table, below are two ways to generate "re-cycling sequential number" First Method: Use Stored Procedure // Select SQL 2nd Method: Use a single SQL Query (which may be what you prefer): Both give the same results: report_number report_id Maybe the best way is to extract the report number from the reports dates itself, if it is also part of the Report table. |
admin 9/14/2021 | |
I would just do it a combination of SQL and PHP code: $c = DBLookup("select report_id+1 from FROM Reports ORDER BY report_id ASC limi 0,1 "); And now $c variable holds your next sequence number and you can do whatever you want to do with it. |
A
|
acpan 9/14/2021 |
I think @Sergey's method is better, it is a standard PHPR way (that's why we love PHPR!), do it in view as. and you can manipuate as you desire, and simple to understand :D |
S
|
SteveA author 9/16/2021 |
Excellent thank you both for your contributions, solved my problem kind regards |