Page 1 of 1

DMAX Function Equivalent in nuBuilder?

Posted: Tue Mar 30, 2021 5:26 am
by pmjd
Hello,

Is there an equivalent to the DMAX function in MS Access?

I have been using the autonumber function in nuBuilder but found that if you delete the highest record number, i.e. 19, the next record will take the value 20 and 19 ends up missing from the database. Is there a way to set the autonumber back, rather than having to manually set it on the Input tab of the form?

Thanks,
Paul

Re: DMAX Function Equivalent in nuBuilder?

Posted: Tue Mar 30, 2021 7:21 am
by Janusz
Hi, you can try as following:
https://www.techonthenet.com/mariadb/au ... _reset.php

Code: Select all

Syntax
In MariaDB, the syntax to reset the AUTO_INCREMENT column using the ALTER TABLE statement is:

ALTER TABLE table_name AUTO_INCREMENT = value;
table_name
The name of the table whose AUTO_INCREMENT column you wish to reset.
value
The next value that will be used in the AUTO_INCREMENT column.

Re: DMAX Function Equivalent in nuBuilder?

Posted: Tue Mar 30, 2021 8:26 am
by kev1n
pmjd wrote: I have been using the autonumber function in nuBuilder
Consider using an SQL AUTO INCREMENT Field

Re: DMAX Function Equivalent in nuBuilder?

Posted: Tue Mar 30, 2021 9:14 am
by pmjd
Thank you guys, will have a look :)

Re: DMAX Function Equivalent in nuBuilder?

Posted: Wed Mar 31, 2021 7:02 pm
by apmuthu
MySQL / MariaDB:

Code: Select all

ALTER TABLE table_name AUTO_INCREMENT = 1;
The above will automatically set it to the next available ID if numeric.