473,399 Members | 3,603 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,399 software developers and data experts.

Cleaning up Null values within a table

52
Do to multiple iterations of data contained in my Event_Log table I now find myself having to update all entries within my Element_Name column that are = “ “ to a Null value. This is necessary for when I am running reports and trying to group by this filed I am getting erroneous entries due to some values being null and some = to “ “. What is the best way to update these “ “ entries to Null? Please note I have several thousand of these entries within my table and doing one at a time would drive a person insane.

Any help would be greatly appreciated.

Birky

Event_Log Table consists of the following columns:

Event_Log_ID
Date_Recorded
Date_Installed
Remedy_AR_Number
Instance
Schema
Project_Name
Element_Name
Version
Comment
Jul 10 '07 #1
3 1799
nico5038
3,080 Expert 2GB
In general I use the NZ() function to change Nulls into a detectable value for a query.
Thus you can exclude empty field by using:
WHERE NZ(TextField,"") = ""

Looks easier as updating, although a simple update query can be used like:

UPDATE tblX SET fieldname = "" where fieldname = Null;

Nic;o)
Jul 10 '07 #2
Birky
52
How would I implement the Nz function within the below select?

SELECT Event_Log.Instance, Event_Log.Project_Name, Event_Log.Element_Name, Max(Event_Log.Version) AS MaxOfVersion
FROM Event_Log
GROUP BY Event_Log.Instance, Event_Log.Project_Name, Event_Log.Element_Name;
Jul 11 '07 #3
nico5038
3,080 Expert 2GB
You need to check in the table definition which fields can contain Nulls.
When that's for instance Project_Name, than use:

SELECT Event_Log.Instance, NZ(Event_Log.Project_Name), Event_Log.Element_Name, Max(Event_Log.Version) AS MaxOfVersion
FROM Event_Log
WHERE NZ(Event_Log.Project_Name) <> ""
GROUP BY Event_Log.Instance, NZ(Event_Log.Project_Name), Event_Log.Element_Name;

The WHERE will make Access to skip empty and Null Projectnames.

Nic;o)
Jul 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
10
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
1
by: Baldur Norddahl | last post by:
Hi, I just noticed that I could do this: webshop=# create table foo (bar text not null primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"...
9
by: John Sidney-Woollett | last post by:
Hi I'm building a web app where changes to customer orders are logged in the following table, and I worried about the time that it will take to locate records that need further...
13
by: Federico Balbi | last post by:
Hi, I was wondering if PGSQL has a function similar to binary_checksum() of MS SQL Server 2000. It is pretty handy when it comes to compare rows of data instead of having to write long boolean...
64
by: yossi.kreinin | last post by:
Hi! There is a system where 0x0 is a valid address, but 0xffffffff isn't. How can null pointers be treated by a compiler (besides the typical "solution" of still using 0x0 for "null")? -...
11
by: Birky | last post by:
I have an issue where I can’t figure out how to open a form where all the objects within are nulled out until a user selects an appropriate Project Name. My form has several objects (12) within which...
2
by: sepe | last post by:
Hello, I've a problem with SQL Server and OLE DB. SQL Server handles NULL as NULL whereas empty string is stored as a space. This is correct when using OLE DB but with ODBC an empty string gets...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.