|
View unanswered posts | View active topics
It is currently Wed Jun 19, 2013 7:17 pm
Due to enormous amounts of spam, the forum has been set to read-only mode.
StampCAT: relocate data between fields
| Author |
Message |
|
Johnny T
Joined: Sun Feb 13, 2005 7:47 pm Posts: 100 Location: Mo i Rana, Norway
|
 StampCAT: relocate data between fields
For my domicile collection I have used the Perforation field to store the dimensions for the objects. Dimensions are stored as Height by Width (don't ask why) and in millimeter measurements, i.e. 89x103 or 130x180.
Are there any way to get the dimensions over from "Perforation_horiz" field to the new "Height" and "Width" fields by SQL statements? And if so how to do it? If not, are there any other solutions except manually? Can I export to Excel forth and back?
I've got more than 2800 object registered in the database and hope to find an easy way to solve this task.
_________________ Windows 7 Pro 32bit StampCAT 10.20 CATraxx 9.40 BookCAT 10.20 AssetCAT 1.10
|
| Wed Oct 26, 2011 6:52 pm |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: StampCAT: relocate data between fields
1. Backup your database! 2. Download and run http://www.fnprg.com/dl/sqlupdate.exe3. Click ... and select your database file. 4. Run this SQL update query: 5. To clear the Perforation Horiz field, run this SQL update query: 6. And finally, to empty the Performation table:
_________________ Fredrik Nordbakke www.fnprg.com
|
| Thu Oct 27, 2011 12:03 pm |
|
 |
|
Ronald de Waal
Joined: Sat Oct 29, 2005 6:29 pm Posts: 40 Location: Netherlands
|
 Re: StampCAT: relocate data between fields
Hello Frederik,
I have almost the same problem with the perforation-field. I entered the following values: 'Kamtanding 13½:14½' 'Lijntanding 13½:15½' and 'Boven, links en onder ongetand'
Now I have to spilt this values in 13½,14½ and 13½,15½ In the third case, without ':', I want to store the values in the field Custom 08.
How do have to change the query?
With kind regards, Ronald de Waal
_________________ With kind regards,
Ronald de Waal
Last edited by Ronald de Waal on Fri Oct 28, 2011 8:42 am, edited 2 times in total.
|
| Thu Oct 27, 2011 12:42 pm |
|
 |
|
Johnny T
Joined: Sun Feb 13, 2005 7:47 pm Posts: 100 Location: Mo i Rana, Norway
|
 Re: StampCAT: relocate data between fields
Hi Fredrik! Thank you for your time! Unfortunately this SQL code resulted in a error. Below I have attached a partly screen shot from my Perforation table and the error message itself, I hope this is enough to troubleshoot the error in executing the SQL code.  And the error message:  Problem mixing Text and Number??
_________________ Windows 7 Pro 32bit StampCAT 10.20 CATraxx 9.40 BookCAT 10.20 AssetCAT 1.10
|
| Thu Oct 27, 2011 3:05 pm |
|
 |
|
Johnny T
Joined: Sun Feb 13, 2005 7:47 pm Posts: 100 Location: Mo i Rana, Norway
|
 Re: StampCAT: relocate data between fields
Hm!
Leaving out the second part of the sql statement ", Width = MID(Perforation.Perforation, INSTR(Perforation.Perforation, 'x') + 1)" resulting in a successful copying to the "Heigth" field.
Running the sql code with above statement alone, resulting in error "ikke samsvar mellom datatyper i vilkårsuttrykk (not consistent between data types in terms of expression)" Any ideas why?
_________________ Windows 7 Pro 32bit StampCAT 10.20 CATraxx 9.40 BookCAT 10.20 AssetCAT 1.10
|
| Thu Oct 27, 2011 7:56 pm |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: StampCAT: relocate data between fields
Most likely. Do any of the entries in the Perforation table contain anything else than a number after the "x" (comma, letters, etc.)?
_________________ Fredrik Nordbakke www.fnprg.com
|
| Fri Oct 28, 2011 10:14 am |
|
 |
|
FredrikN
Site Admin
Joined: Fri Nov 22, 2002 3:52 pm Posts: 13748
|
 Re: StampCAT: relocate data between fields
It isn't really possible to use a sql update query here since you want to transfer the data to a lookup field.
_________________ Fredrik Nordbakke www.fnprg.com
|
| Fri Oct 28, 2011 11:00 am |
|
 |
|
Ronald de Waal
Joined: Sat Oct 29, 2005 6:29 pm Posts: 40 Location: Netherlands
|
 Re: StampCAT: relocate data between fields
Hello Frederik, I shell try to transfer the data with a VB-routine. Thanks. With kind regards, Ronald de Waal
_________________ With kind regards,
Ronald de Waal
|
| Fri Oct 28, 2011 12:55 pm |
|
 |
|
Johnny T
Joined: Sun Feb 13, 2005 7:47 pm Posts: 100 Location: Mo i Rana, Norway
|
 Re: StampCAT: relocate data between fields
Yes, you are right again! I have overlooked that record 241 contained two x's. Once I removed one of the x's, then the sql code ran well. Case solved! Thank you!
_________________ Windows 7 Pro 32bit StampCAT 10.20 CATraxx 9.40 BookCAT 10.20 AssetCAT 1.10
|
| Fri Oct 28, 2011 2:12 pm |
|
 |
|
Johnny T
Joined: Sun Feb 13, 2005 7:47 pm Posts: 100 Location: Mo i Rana, Norway
|
 Re: StampCAT: relocate data between fields
Please report back if you succeed, maybe I to will have a try!
_________________ Windows 7 Pro 32bit StampCAT 10.20 CATraxx 9.40 BookCAT 10.20 AssetCAT 1.10
|
| Fri Oct 28, 2011 4:57 pm |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|