Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Update query shift down by 1
Name: bigwebidea Date: August 8, 2008 at 08:02:43 Pacific OS: Windows XP CPU/Ram: 1gb Product: HP
Comment:
I'm using MS Access trying to create an update query that shifts the data down by 1 row. Example: field1 data 1 data. 2 data(3)
UPDATE DataTable SET DataTable.field2 = field1 [shifted down by 1 row];
field2 [empty] data 1 data. 2 data(3)
It would also be great if I could reformat the data at the same time.
Name: Elinor Date: August 11, 2008 at 13:04:51 Pacific
Reply:
Hi,
Just wondering whether you could give a little more information about the table(s). For instance, are both those fields in the same table? And what's your primary key and its values?
Name: bigwebidea Date: August 11, 2008 at 13:22:11 Pacific
Reply:
Yes, both fields are in the same table. Currently, I have it setup in a single table. The primary key is a different field and is a 7 digit number, but if I need to I can change any of this if there is a way to make it work.
There are over 160,000 records
Thanks!
0
Response Number 3
Name: Elinor Date: August 19, 2008 at 08:15:27 Pacific
Reply:
Honestly, I don't think this can be done using just SQL. :S
Summary: Hello, here is my short script in sql server 2000: [b]Create Table #tmp(ID int,y_val char(30),...) Insert Into #tmp exec stored_procedure[/b] now my #tmp is filled with [u]214[/u] rows, 87 of them hav...
Summary: thx for your input, but dates are not incremented by 1 for each value, like I said, they're completely random... let me give you a clearer example: 2009-02-05 x1 y1 z1 2009-04-18 x2 y2 z2 2009-06-06 x...
Summary: First I would say this is something you should not do. What you have is a one to many relationship. One address with many contacts. If you have 2 tables, you could create a form that cycles through...