Senin, 24 April 2017

Re: [MS_AccessPros] Autonumber Default Value = 0; Good or Bad?

 

adding onto what John said ...

except for a couple versions, Access automatically supplies a Default Value of 0 when a Number data type is chosen.  Probably so math equations would not have to be wrapped with NZ to work .... but a Default Value is rarely appropriate for a foreign key -- and even then, it would probably be something different.  Therefore, be sure to always DELETE the Default Value of 0 for numeric foreign keys (and possibly other numbers too) unless you have given it consideration and it is truly what you want.

respectfully,
crystal
 
~ have an awesome day ~


On 4/24/2017 10:39 AM, John Viescas JohnV@msn.com [MS_Access_Professionals] wrote:
Then get rid of the 0 default value.
 
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Apr 24, 2017, at 5:28 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



OOPS! my mistake with mis-written question.

These are not autonumber fields, they are child key fields of the number type but are not autonumber.


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

David-

It doesn't matter - that Default 0 will be ignored by an AutoNumber field.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Apr 24, 2017, at 5:05 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have a number of autonumber ID fields.  When I create one of these fields Access always creates a default value of 0 (zero).  Is this a good idea to do, or is it better to have no default value for these fields?









__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar