473,804 Members | 4,223 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating "empty records" in Access

1 New Member
Hi there. I am trying to figure out a way to create a series of empty records in a database (ACCESS 2003). Basically, the table has 10 years of information by id. However, if there is no ID, then there is no record. I would like to make a record that simply does not have any data in it in that case.

For instance if have:

Expand|Select|Wrap|Line Numbers
  1. ID   YEAR      DATA
  2. a        1            xxxxx
  3. a        2            xxxxx
  4. a        3            xxxxx
  5. a        4            xxxxx
  6. b        1            xxxxx
  7.  
But I would like
Expand|Select|Wrap|Line Numbers
  1. ID   YEAR      DATA
  2. a        1            xxxxx
  3. a        2            xxxxx
  4. a        3            xxxxx
  5. a        4            xxxxx
  6. a        5 
  7. a        6            
  8. a        7            
  9. a        8            
  10.  
I have a table with just the year numbers in it that I tried to JOIN, or UNION, but that did not work because I could not figure out how to match the IDs to it (not in the years table). There are about 6000 IDs in the table that I am trying to manipulate.

I know how to do this using php or VBA code, but I am looking for a way to do if purely in SQL. Any advice that you guys have would be much appreciated.

Thanks
Nov 4 '07 #1
1 1868
Rabbit
12,516 Recognized Expert Moderator MVP
Table3 if your data. Table4 is a list of years.
Expand|Select|Wrap|Line Numbers
  1. SELECT y.*, Table3.Data INTO tbl_Test
  2. FROM [SELECT x.*, Table4.* FROM (SELECT DISTINCT ID FROM Table3) AS x, Table4]. AS y LEFT JOIN Table3 ON (y.Year = Table3.Year) AND (y.ID = Table3.ID)
  3. ORDER BY y.ID, y.Year;
  4.  
Nov 5 '07 #2

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

Similar topics

4
2689
by: Marcin Dobrucki | last post by:
I've been having some problems with a parse error that I can't figure out (PHP 4.3.11 on Solaris9). Sample code: <?php // getting strange parse errors on this class A { var $value; function A() { $this->value = 1; }
2
2338
by: Jerry Boone | last post by:
Funny thing happened today... I thought I was going to be smart and customize my menu's by dragging the Refresh option from the Records menu onto the toolbar in Access 2000. When doing so, I missed and dropped it onto the dark mdi window and it was as if it fell in a black hole... and worse... it's not in the menu anymore either. Is this a reinstall... or has anyone else made this bloop and fixed it? I tried to recreate it, but doesn't...
0
1355
by: jimmojelsky | last post by:
Access97 database - it is set up to share between several computers - some users have full access, others only have read access - locking is set at "no lock" - everything works unless one of the workstations has an open query - the other workstations then get a "records locked" message if they attempt to run a query - I have been trying to solve this one for quite some time - can anyone help? -- Posted via http://dbforums.com
3
2582
by: Vic | last post by:
Dear All, I have a database of laboratory records in Access 2000. There is one form which acts as an interface to input experimetal data. This form incorporates information from several tables. I have a flag (yes/no field) indicating whether a particular experiment (one record) is completed (ie all data belonging to that record is inputted and quality controlled). What I want is that when I change the flag to "yes" the particular record...
8
10413
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have is not much help here either. Googling has given me a little help. This is my current understanding -- I would appreciate any comments or corrections... "" -- this means an empty string when applied to String data type, and also to Variant...
7
2178
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. Here's what I discovered. In addition to my main web project and several middle tier projects, I also added an "empty" web project in my solution (Add - New Project - Empty Web Project). This empty web project is what is causing the above...
10
24192
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
7
1878
by: bbasberg | last post by:
Hello, I thought I would do a "sanity check" by asking the experts how to do the following: I need to process external data (it will be in an Access DB table and will be updated daily) into a local Access DB table that has the same structure with additional fields. The local table is prexisting and the designer used an autonumber field as its key. There is a "real key" between the two tables (let's call it PK1 for this discussion (it's...
1
2284
by: psyvanz | last post by:
any code that can delete all records in just one click if you have a dataenvironment code it more good.. cause im working in this kind of code. like this: single delete code (not all in the records) dataenvironment1.command1.delete thats all i can do... i want to know how to create a code that can delete all records code in just a single click... of a command button..
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.