Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a Changeto query

Status
Not open for further replies.

jiminy

Technical User
Jan 26, 2002
30
0
0
US
I am trying to use the changeto command in a query to change a numerical (N type) field with a calculation. This would affect all the records in the table.
I get an error msg saying I am trying to link 2 tables (WRONG) and the fields are not the same type (number fields should have no problem). Example: number, changeto number*2. I am using exactly the format given in the Pdox help window. What gives? This is with Pdox 9 for windows 2000.
 
There could be a difference in the field type (e.g. Number vs. Short or Long Integer). We can't see your query, so save the query and post the resulting text file (Query.qbe) so that it can be better analyzed.
 
As you know/ don't know, you have to make sure that you join the two tables with a field that has the exact same data that is constant within the two tables (ssn, employee numbers, etc. etc.). Then do the Changeto command on the fields that you are trying to change the data. I know this is just basic info, but you never know when you miss the little things. I know I kept screwing this aspect up when I first started to use Paradox. And yes, please post some sample data of the fields that you are joining, and a sample of the data fields that you are running the Changeto command on :)
 
It sounds like you are using the example element incorrectly. If you are using the interactive query tool, make sure you press F5 before typing the name of the example element (in your case the word 'number'). It should be red text. So you would type:

1) F5 (press the F5 key)
2) Number (this will be red)
3) , (this will be black)
4) Changeto (this will be black)
5) (press the SPACEBAR)
6) F5 (again)
7) Number (again, this will be red)
8) * (this will be black)
9) 2 (this will be black)

If this is a query inside a script or code then you simply precede the example elements with an underscore:

Code:
myTable.db | myNumField                  |
           | _number, changeto _number*2 |



Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
D'OH! Forgot about mentioning the F5 key. See! If you miss the little things, they can sure screw you up :)
 
FWIW, you can also enter an example element directly into a QBE window by pressing the underscore key instead of F5.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top