D
daksport00
I am trying to create a bit of code that will select values from a
particular table, Update them such that only the first 4 characters
remain, then remove the duplicate values that are then created.
I can work this by creating 3 seperate queries, then run the macro when
the program is run. However, doing it this way creates a temporary
table which is not friendly when there are multiple users using the
database.
Here is the SQL for the queries I have right now:
Select Query:
SELECT DISTINCT [Fabrication Drawings].[Drawing Number] INTO NewFabDwg
FROM [Fabrication Drawings];
Update Query:
UPDATE DISTINCTROW NewFabDwg SET NewFabDwg.[Drawing Number] =
Left([Drawing Number],4);
Append Query:
INSERT INTO AllDwgQuery ( [Drawing Number], [Drawing Name], [Furnace
Model], [Job Number], [Serial Number], [Size], Author, [Date], [Current
Revision] )
SELECT [Fabrication Drawings].[Drawing Number], [Fabrication
Drawings].[Drawing Name], [Fabrication Drawings].[Furnace Model],
[Fabrication Drawings].[Job Number], [Fabrication Drawings].[Serial
Number], [Fabrication Drawings].Size, [Fabrication Drawings].Author,
[Fabrication Drawings].Date, [Fabrication Drawings].[Current Revision]
FROM [Fabrication Drawings];
************************
The background for this is that I am creating a database program that
will Create and Organize drawings for my company. These queries are
used to create a list of current drawing numbers whenever a user
selects to create a new drawing or update info for an old drawing.
Drawing numbers look like FD01-01, FD01-02, FD01-03, FD02-01, etc. The
first part (FD01) relates to a specific customer order, the second part
(-01, -02) identifies the drawing itself.
The program is setup such that when you go to create a new drawing
number, you are presented with a form that has a combobox that shows
only the first part of the drawing number, and a text box where a user
will input the second part, or you can type NEW in for the first part
of the drawing number, and the program will create a new drawing number
for you.
************************
Hopefully this is enough info to show what I am trying to do and why I
am trying to do it.
Any help I can get on this would be much appreciated.
-Dave
particular table, Update them such that only the first 4 characters
remain, then remove the duplicate values that are then created.
I can work this by creating 3 seperate queries, then run the macro when
the program is run. However, doing it this way creates a temporary
table which is not friendly when there are multiple users using the
database.
Here is the SQL for the queries I have right now:
Select Query:
SELECT DISTINCT [Fabrication Drawings].[Drawing Number] INTO NewFabDwg
FROM [Fabrication Drawings];
Update Query:
UPDATE DISTINCTROW NewFabDwg SET NewFabDwg.[Drawing Number] =
Left([Drawing Number],4);
Append Query:
INSERT INTO AllDwgQuery ( [Drawing Number], [Drawing Name], [Furnace
Model], [Job Number], [Serial Number], [Size], Author, [Date], [Current
Revision] )
SELECT [Fabrication Drawings].[Drawing Number], [Fabrication
Drawings].[Drawing Name], [Fabrication Drawings].[Furnace Model],
[Fabrication Drawings].[Job Number], [Fabrication Drawings].[Serial
Number], [Fabrication Drawings].Size, [Fabrication Drawings].Author,
[Fabrication Drawings].Date, [Fabrication Drawings].[Current Revision]
FROM [Fabrication Drawings];
************************
The background for this is that I am creating a database program that
will Create and Organize drawings for my company. These queries are
used to create a list of current drawing numbers whenever a user
selects to create a new drawing or update info for an old drawing.
Drawing numbers look like FD01-01, FD01-02, FD01-03, FD02-01, etc. The
first part (FD01) relates to a specific customer order, the second part
(-01, -02) identifies the drawing itself.
The program is setup such that when you go to create a new drawing
number, you are presented with a form that has a combobox that shows
only the first part of the drawing number, and a text box where a user
will input the second part, or you can type NEW in for the first part
of the drawing number, and the program will create a new drawing number
for you.
************************
Hopefully this is enough info to show what I am trying to do and why I
am trying to do it.
Any help I can get on this would be much appreciated.
-Dave