Topic: Folios/Pages starting at 0 in Summary Table, Compound SELECT, +more
So this whole idea started when I was messing with the SQL Tables for the first time in QET. I decided I wanted the Title Page of my project to be page 0 and not shown in a Table of Contents.
I originally had issues because Folio number shows the folio # / Total # of Folios. I wanted to only show the folio # and manipulate it. What I came up with was
SELECT pos-1 AS Page, title FROM project_summary_view ORDER BY pos LIMIT 26 OFFSET 1
Found out pos is my folio # and the -1 allows me to modify the #. The OFFSET 1 allows me not to show page 0 in the Table of Contents as this is my Title page. However, I want to expand upon this but running into a couple of issues with doing so.
The first issue is the Title Block. %folio-num for the Page: number displays at folio/folio-total and adding a -1 just adds the -1 as a text. Example: 2/26-1. I was able to get around this with %previous-folio-num which works for the above specific example. Another smaller issue is that the page total is off by 1. I wasn't planning on figuring that out since it wasn't that big of a deal. However, more issues if I expand upon the idea.
The second issue is with multiple SELECT statements. I thought I could do something like SELECT "" || "I." AS Page, title from project_summary_view ORDER BY pos LIMIT 1 OFFSET 1; SELECT pos-2 AS Page, title from project_summary_view ORDER BY pos LIMIT 26 OFFSET 2
Was trying to get the Table of Contents to show up as I. and Folio 3 is Page 1. The above statement does not work. Even if it did, I will have further problems with the title blocks as I will at the very least need to make the folio # in the title block match my Page # in the Summary Table.