Hi All,
Can't seem to find a simple auto incrementing counter.
I have a table (tblServiceCounter) [see viewtopic.php?f=13&t=69091#p308127], where I need to auto increment a record, based on use.
Every time a Service is selected, the counter should increase with '1'.
Dream
[Solved] Simple incrementing counter
-
- Posts: 881
- Joined: Mon May 30, 2011 4:02 am
[Solved] Simple incrementing counter
Last edited by dreamquartz on Mon Apr 21, 2014 7:11 am, edited 2 times in total.
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
Re: Simple incrementing counter
Add the service to a table every time a service is used.
This records an automatic time stamp too. All you need is a "new records only form" with one list box of services.
Code: Select all
CREATE TABLE "tblServiceUsage"(
"SID" INT NOT NULL,
"TS" TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
"ID" INT GENERATED BY DEFAULT AS IDENTITY,
FOREIGN KEY ("SID") REFERENCES "tblServices"("ID")
)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 881
- Joined: Mon May 30, 2011 4:02 am
Re: Simple incrementing counter
Thank you Villeroy,Villeroy wrote:Add the service to a table every time a service is used.This records an automatic time stamp too. All you need is a "new records only form" with one list box of services.Code: Select all
CREATE TABLE "tblServiceUsage"( "SID" INT NOT NULL, "TS" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "ID" INT GENERATED BY DEFAULT AS IDENTITY, FOREIGN KEY ("SID") REFERENCES "tblServices"("ID") )
I will investigate.
I am, however at this point, not quite sure what you mean by: "All you need..........", but I should be able to figure that out.
Keep you posted of the progress,
Edit: figured out what you meant by: "All you need..........".
OK.
Turns out that I did not ask the right question in the 1st place.
I thought I could make it into a separate topic, but apparently that does not work.
So, I will state this topic as [SOLVED] and will continue with viewtopic.php?f=13&t=69091 where this question originated.
So please, look at that topic to see if you can help me with the counter.
Dream.
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.