Query to duplicate last entry

G

Guest

Hi,
I need to duplicate the last entry in a table (except one field).
For example if my table is (my key is a combination of ID and Version)

ID Version Name Salary
2 1 Bob 100
3 1 John 90
4 1 Dan 95


I will need to add an entry of
4 2 Dan 95

Any idea what query/sql I should use.

Many thanks,
Dan
 
S

Steve

Dan,

Your table looks to be incorrect. Before you proceed further, why don't you
describe what you are trying to do in your database and we can help you get
on the right path.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Steve,
My tabe is correct? not sure I follow (why will it be incorrect?)
ID Version Name Salary
2 1 Bob 100
3 1 John 90
4 1 Dan 95

I need to be able to add a new row for any id, duplicating the entries ,
just pushing the Version number one up.

So if the parameter id ID 3
A new row will be created making my table looks like

ID Version Name Salary
2 1 Bob 100
3 1 John 90
4 1 Dan 95
3 2 John 90

Thanks
 
K

Keith Wilby

Dan said:
Steve,
My tabe is correct? not sure I follow (why will it be incorrect?)

There's nothing wrong with your table Dan, Steve is just trying to bait you
into parting with money. More info about Steve here:

http://home.tiscali.nl/arracom/whoissteve.html

If I'm understanding you correctly then you want to increment the Version
number. Try using the DMax function in an append query to find the highest
version number and add 1.

Keith.
www.keithwilby.com
 
S

Steve

I don't know what your "ID" is but you ought to be using autonumber. What is
Version? If you look at the results you want, you are duplication names, IDs
and Versions. That's not a correct design for a table!

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Steve, That is the most stupid answer I ever saw.
Please do not ever reply to any of my questions again!!!!!!!!!!!!!
you are just incompetent!

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top