473,378 Members | 1,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Force Zeros into inmatched fields in Append Process

Hi:

I have a situation where I am appending records to a table, and some of the records do NOT
have all the fields in them that the table has. In those cases, the field is filled with a
null but the normal append process. Does anyone know of an easy way to force the use of a
0 (zero) rather than a null when fields don't match on an append? It would make life much
easier down the line where I haver to do summing and things, and sometimes null doesn't
behave exactly the same as a zero!

Thanks

John Baker
Nov 12 '05 #1
2 2177


John Baker wrote:
Hi:

I have a situation where I am appending records to a table, and some of the records do NOT
have all the fields in them that the table has. In those cases, the field is filled with a
null but the normal append process. Does anyone know of an easy way to force the use of a
0 (zero) rather than a null when fields don't match on an append? It would make life much
easier down the line where I haver to do summing and things, and sometimes null doesn't
behave exactly the same as a zero!

Thanks

John Baker


Use an expression
IIF(Nz([Field],0) > 0,[Field],0)

Of course, you could set the DefaultValue to zero in the table...or else in the form.
Nov 12 '05 #2
Thanks:

Of course..its a table.. set the default to zero!

I should have through of that!

Thanks

John

Salad <oi*@vinegar.com> wrote:


John Baker wrote:
Hi:

I have a situation where I am appending records to a table, and some of the records do NOT
have all the fields in them that the table has. In those cases, the field is filled with a
null but the normal append process. Does anyone know of an easy way to force the use of a
0 (zero) rather than a null when fields don't match on an append? It would make life much
easier down the line where I haver to do summing and things, and sometimes null doesn't
behave exactly the same as a zero!

Thanks

John Baker


Use an expression
IIF(Nz([Field],0) > 0,[Field],0)

Of course, you could set the DefaultValue to zero in the table...or else in the form.


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: TheTeapot | last post by:
Hi all, Here's a puzzle: // Say I have an array of numbers set up like so: $arr = array(15,16,17,100,121,1000); // How can I create a function so that I can use it like so:...
1
by: mmmgood1 | last post by:
Help, I'm linking an excel spreadsheet in access and I have datafields with leading zeros (01021). When the file is linked in access, I get a #num in the field with the leading zeros. The zeros...
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
5
by: tpcolson | last post by:
I have a fairly large access 2003 table (200,000) records. Field 'X' is a text field, and contains either no value, 4 digits, 5 digits, or 6 digits. What I need to do is to add two zeros to the...
6
by: TN Bella | last post by:
I have a simple text box called txtrefnum, if the user enters a number length less than 9 characters long than I need to have lead zeros added to it. Does anyone know how to do this? I couldn't...
1
by: MLH | last post by:
What might a FN look like to put the following lines in if such FN accepted an array of desired fieldnames and fieldtypes? I would like to have the functional lines that follow in a FN that...
9
by: Chester | last post by:
I'm working on an app that records data collected by service technicians (VB.Net front-end, SQL Server 2000 back end). The technicians need to record numbers with varying scale and precision. For...
3
by: travellinman | last post by:
Hi, I'm trying to combine the text in two original fields and paste them into another 3rd field on a form, but the problem is that there are leading zeros in both original fields, which access does...
6
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.