FatherNature
New member
- Local time
- Today, 12:21
- Joined
- Jun 18, 2010
- Messages
- 4
I have a tricky problem that I am trying to work around. I have a database that needs to create a datafile in a specific format. The keys are in a staggered array, and I need the query to generate the data with the gaps filled in, a simplified example follows:
The database is a beast, to add in the twelve datapoints (I need to add) using the existing method would be hideous and may have unintended consequences with other database queries.
Any help you can give is greatly appreciated,
David
ID DATA
500 12
501 20
502 100
505 12
506 16
508 30
...
after running the query this would become:500 12
501 20
502 100
505 12
506 16
508 30
...
ID DATA
500 12
501 20
502 100
503 null
504 null
505 12
506 16
507 null
508 30
...
I would like to generate the full sequence for the range of keys in visual basic and then tie my data to this generated field, but since I'm new to database programming I'm open to other suggestions. If I can get this to work properly it will dramatically simplify an existing (broken) query (4 pages of SQL in 11 point font would become less than a single page and would clear up any other ommisions that were overlooked). 500 12
501 20
502 100
503 null
504 null
505 12
506 16
507 null
508 30
...
The database is a beast, to add in the twelve datapoints (I need to add) using the existing method would be hideous and may have unintended consequences with other database queries.
Any help you can give is greatly appreciated,
David
Last edited: