Update query

S

subs

i have a table with weights as a column such as

weight wgt range

2000
1200
50
80
12000

i want a SQL query which can update the wgt range column automatically
with the run of the query
for example in the above example the wgt range column will be

Wgt range
1000-2000
1000-2000
1-1000
1-1000
11000-12000.

Range is in steps of 1000. Pls help with SQL query. i could do this in
design view by updating each time with a criteria. i want a sql query
which can do this at one shot. Pls help Thanks
 
D

Douglas J. Steele

Having such a field in your table is actually a violation of database
normalization rules, since its value is entirely derivable from nothing more
than another field in the same row.

Instead, create a table that contains the information about your desired
ranges, and join that table to your existing table in a query. Use that
query wherever you would otherwise have used the original table. Allen
Browne has a discussion about this at http://www.allenbrowne.com/ser-58.html
or you can check my December, 2004 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free at http://www.accessmvp.com/djsteele/SmartAccess.html
 

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

Urgent query needed 2
sql 2
sql required 1
sql help req 1
query needed please help 6
Insert formula and copy to a range of cells above 2
Parameter Value 4
Running Balance (Debit and Credit) in Access 2007 3

Top