
Quote from CSSystems on November 30, 2022, 11:50 pmI should know this by now but..
I am developing a receipt database app which requires a receipt number.
I would like to start at 1000 and increment by one (which I know is what autoinc field does).
How do I start at 1000 ? the best way.
I should know this by now but..
I am developing a receipt database app which requires a receipt number.
I would like to start at 1000 and increment by one (which I know is what autoinc field does).
How do I start at 1000 ? the best way.
Quote from mishem on December 1, 2022, 12:53 pmInteger, BigInt, AutoInc, Currency and Float Fields:
0
If the number being formatted has a digit in the position where the "0" appears in the format string, then that digit is displayed. Otherwise, a "0" is displayed in that position.
#
If the number being formatted has a digit in the position where the "#" appears in the format string, then that digit is displayed. Otherwise, nothing is displayed in that position.
.
The "." character determines the location of the decimal point in the displayed number. The actual character displayed is the decimal separator defined in the Windows Control Panel.
,
Including at least one "," character in the format string will display the number with thousand separators inserted between each group of three digits to the left of the decimal point. The placement of the "," character isn't important as it's merely an indicator that thousand separators are wanted. The actual character displayed is the thousands separator defined in the Windows Control Panel.
|
Separates sections for positive, negative, and zero numbers in the format string.
The formatted number will be rounded to as many decimal places as there are digit place holders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the number will be rounded to the nearest whole number.
If the formatted number contains more digits to the left of the decimal separator than there are digit place holders to the left of the "." character in the format string, the extra digits are will still be displayed.
Below are some example numeric format strings:
Format String
Number
Displayed Value
Comments
#.##
125.5
125.5
Extra digits to the left of decimal still appear.
#.000
2.5
2.500
Extra zeros added to the right of decimal.
00.##
.007
00.01
Zeros added to left of decimal and fractional part rounded to two decimal places.
$#.00
125.5
$125.50
Dollar sign added to left of number and extra zeros added to the right of decimal.
You may optionally provide different format strings to be used for positive, negative and zero values. Separate the three sections with the pipe (|) character. For example:
#.00|(#.00)|None
Integer, BigInt, AutoInc, Currency and Float Fields:
|
0 |
If the number being formatted has a digit in the position where the "0" appears in the format string, then that digit is displayed. Otherwise, a "0" is displayed in that position. |
|
# |
If the number being formatted has a digit in the position where the "#" appears in the format string, then that digit is displayed. Otherwise, nothing is displayed in that position. |
|
. |
The "." character determines the location of the decimal point in the displayed number. The actual character displayed is the decimal separator defined in the Windows Control Panel. |
|
, |
Including at least one "," character in the format string will display the number with thousand separators inserted between each group of three digits to the left of the decimal point. The placement of the "," character isn't important as it's merely an indicator that thousand separators are wanted. The actual character displayed is the thousands separator defined in the Windows Control Panel. |
|
| |
Separates sections for positive, negative, and zero numbers in the format string. |
The formatted number will be rounded to as many decimal places as there are digit place holders ("0" or "#") to the right of the decimal point. If the format string contains no decimal point, the number will be rounded to the nearest whole number.
If the formatted number contains more digits to the left of the decimal separator than there are digit place holders to the left of the "." character in the format string, the extra digits are will still be displayed.
Below are some example numeric format strings:
|
Format String |
Number |
Displayed Value |
Comments |
|
#.## |
125.5 |
125.5 |
Extra digits to the left of decimal still appear. |
|
#.000 |
2.5 |
2.500 |
Extra zeros added to the right of decimal. |
|
00.## |
.007 |
00.01 |
Zeros added to left of decimal and fractional part rounded to two decimal places. |
|
$#.00 |
125.5 |
$125.50 |
Dollar sign added to left of number and extra zeros added to the right of decimal. |
You may optionally provide different format strings to be used for positive, negative and zero values. Separate the three sections with the pipe (|) character. For example:
#.00|(#.00)|None


Quote from CSSystems on December 1, 2022, 5:45 pmI understand the formatting. That's not my question.
Autoincrement is adding one (1).
But I want to start at 1000 and add 1 for 1001 then 1002 etc like Invoice numbers.
I looked back at an Invoicing app I developed in the past and there is a technique there but doesn't use autoincrement.
Thanks for your thoughts.
I understand the formatting. That's not my question.
Autoincrement is adding one (1).
But I want to start at 1000 and add 1 for 1001 then 1002 etc like Invoice numbers.
I looked back at an Invoicing app I developed in the past and there is a technique there but doesn't use autoincrement.
Thanks for your thoughts.

Quote from ebear on December 2, 2022, 11:30 amDepending on your database:MySQL: AUTO_INCREMENT=1000 Access:AUTOINCREMENT(1001,1) SQLite:sqlite_sequence SET seq = 1000MS-SQL: id int IDENTITY(1000,1) Best regards, Eric
Depending on your database:
MySQL: AUTO_INCREMENT=1000
Access:AUTOINCREMENT(1001,1)
SQLite: sqlite_sequence SET seq = 1000
MS-SQL: id int IDENTITY(1000,1)
Best regards,
Eric
Quote from PaulJonestindall on December 5, 2022, 1:06 pm@cssystems
My quickest solution would be to simply create a loop to add and delete 1000 records in your database. Your autoinc would then be at 1001.
If you're concerned about the size with an Access DB file, you can compact it. That should get rid of the empty records within the file.Hope that helps.
My quickest solution would be to simply create a loop to add and delete 1000 records in your database. Your autoinc would then be at 1001.
If you're concerned about the size with an Access DB file, you can compact it. That should get rid of the empty records within the file.
Hope that helps.

Quote from CSSystems on December 10, 2022, 4:37 pmSorry for not replying.
Just had a hip replacement.
I am using access. When I get mobile again I will look at Auto increment (1000,1)
Sorry for not replying.
Just had a hip replacement.
I am using access. When I get mobile again I will look at Auto increment (1000,1)