Page 1 of 1
[Solved] Simple incrementing counter
Posted: Sun Apr 20, 2014 6:25 pm
by dreamquartz
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
Re: Simple incrementing counter
Posted: Sun Apr 20, 2014 7:01 pm
by Villeroy
Add the service to a table every time a service is used.
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")
)
This records an automatic time stamp too. All you need is a "new records only form" with one list box of services.
Re: Simple incrementing counter
Posted: Mon Apr 21, 2014 5:54 am
by dreamquartz
Villeroy wrote:Add the service to a table every time a service is used.
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")
)
This records an automatic time stamp too. All you need is a "new records only form" with one list box of services.
Thank you Villeroy,
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.