Update query

  • Thread starter Thread starter subs
  • Start date Start date
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
 
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
 
Back
Top