Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default value on SQL Table Not working

Status
Not open for further replies.

phweston

Programmer
May 8, 2003
38
0
0
We have a SQL table where we want to set the default value for some of the fields = 0. This is too avoid having a null value in the field when there is no value for these fields. These fields are set to the data type "money".

When we append records to the table(using MS Access as a front end), for some reason the default value of 0 is not inserted to the table where it should be, and we still end up having all these null fields.

Any thoughts? Should we be using another numeric data type?
 
The reason for this, I would guess is that you have a field on your access form where you dont enter anything. Though the access application is actually sending through the value in this field.

A default will only work where no value is specified not if a null is passed through

You can check this by running SQL profiler and capturing the DB calls through from Access.

If you need a default value and are using Access as a front end, set the default value in the Access form.



"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top