ronthet
04-28-2010, 03:41 PM
I know to do an update query table, but I do not think this will work. The deal is I created a basic table with all text formatting. One field is called distance. I type in 00.1 or 01.01 or 05.9 etc. All as text. I now need to change some of these by adding 02.0 to them. I used my garmin gps and put in address. I am trying to locate the closest fire station to a point I pick on my GPS. the purpose is to find the fire engine and ambulance that should respond to that point by distance. So my table has the grid(point), station number, distance. I create another table with station and list engines and ambulance etc in that table. I built a query that show the closest stations/unit by sort on grid, distance. I now need to add 2 miles to the stations that are out of town. We use neighboring cities stations for what we call automatic assist. If they are closer than one of our stations then we would call them to repsond. We want 2 miles added because of the time delay in calling another city, giving them the address/info etc, then that city send the fire engine etc. Sorry this is so long and I hope it is in the right place. Thank you.
John Big Booty
04-28-2010, 04:10 PM
This thread (http://www.access-programmers.co.uk/forums/showthread.php?t=160978) may give you some ideas.
ronthet
04-29-2010, 03:27 PM
I donot understand the access thing with the shap file. I am very limited. I really just want to change some data from 01.2 to 03.2 based on a field with station number. example I want to change all the distance for station 101. i have 101 entered 300 plus times. all the distance can vary from 0.1 to 06.7 etc. I have about 10 or 15 additional station with the same info, so I really need to change 16 x300 plus so I am talking a lot of row of data
PNGBill
04-29-2010, 03:58 PM
Is the problem not actually the update query but rather the field format ie. it should be simple to update a selected number of records by adding 2 to the value but if the records hold some data format that doesn't want to know about adding 2 to it then that may be the real problem.
If so, then could you select the records, dump the data to another temp table, change the format, update the record, change the format back to what you wanted and then update your original data ?
If the value is a number but actually a text file then you may need to convert the text file to a number update the value and then convert back to a text file.
Ignore this if on the wrong track.
ronthet
04-29-2010, 05:08 PM
the data is all formatted as text. I can/have copied some data into excel and set the format to number, but then the leading zeros go away. The issue is I need the leading zero to sort by. It seem to want to sort like 1 10 2 21 22 3 etc. the sample data look like this.
Grid Station Dist
1001 115 00.5
1001 122 01.3
1001 111 01.3
The sample here I I enter 01.3 for 122 and need to have it say 03.3. Again this is all text in access. I have 321 grids with station 122 appearing in all with difference dist of course. I can put it in excell but it show the error but I am still able to adde 2, but the column with the result do not let me drag the formula down the sheet to get the 4000 plus records. I am by no mean a real advance user of either excel or access since 2007 is out. Just got it installed by IT and have at it. A lot of changes on both I still need to find.
PNGBill
04-29-2010, 05:17 PM
If you only need to change the last part of your record then there are functions that will extract the last so many chrs and then you manipulate these and then update just the last chrs again of your original record.
You can do this for names so should be possible with numbers that are text.
PNGBill
04-29-2010, 05:21 PM
you really just need to update the third and fourth characters from the end of the string ?
John Big Booty
04-29-2010, 05:59 PM
To expand on PNGBill's suggestion check out the String Functions here (http://www.techonthenet.com/access/functions/index.php).