Newbies vandal69 Posted October 20, 2005 Newbies Posted October 20, 2005 Hi, I have the following problem: I have a table called 'transactions_tmp' with the following (relevant) fields: account amount description_1 description_2 This table is populated by importing a comma seperated text file. After the import, I want to copy data from 'transactions_tmp' to a table called 'transactions' that ha the following fields: account amount description 'description_1' and 'description_2' from 'transactions_tmp' have to be concatenated into field 'description' in table 'transactions' (there are more processing steps between 'transactions_tmp' and 'transactions', but I will use the concatenation for example purposes) How can I copy the data from transactions_tmp' to 'transactions' record by record and do some processing on the fields in between by using a script? So the steps would be something like this: - take 'description_1' and 'description_2' from 'transactions_tmp' - concatenate them - write this into field 'description' in 'transactions' - take 'amount' from 'transactions_tmp' - do some calculations on 'amount' - write result into field 'amount' from 'transactions' - take field ..... - .. - and then loop through all the record from 'transactions_tmp' this is where my scripting knowledge lacks... Thanks!
Zero Tolerence Posted October 20, 2005 Posted October 20, 2005 Set up a relationship by Account and Ammount being equal. Make sure your relationship says you CAN create records in your "transactions" table via this relationship. In your loop, just do: SetField[Transactions::Description; Transactions_tmp::description1 & Transactions_tmp::description2] If you have your relationship set up correctly, all you should have to do is run that loop, it will create the records in your transaction tables for you, and you don't need to set the account or the ammount. If you need to do some calculations on your "ammount" just relate the "account" field plus like a timestamp field or something. then do a set field on the description, and on the ammount after your done with it.
Recommended Posts
This topic is 6976 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now