Going to be a bit blunt here, but some work on your part now in understanding how things work will pay off. I know it's hard in the beginning.
Working around your programming errors by programming more inefficient code is going to work... until you hit the next error...
Working around other people's errors on the other hand..

With this behind us:
must import the data from a table and use it as a variable, so that i can run the calculations in the program itself
What have you tried yourself? What approach do you think would work? What documentation have you read and what did not make sense to you/work?
From a basic perspective, I'd extract the data from the databse, perform the calculation and store the result (= what you said in your question).
If you need to loop through a table/view when calculating data, you should do that.
What have you tried yourself? What error messages do you get?
It's very difficult to answer these kinds of questions without giving ready made snippets of code that possibly might work for you (or not at all) and probably won't help in your understanding of what is going on...
In addition, there's tons of wiki pages, Delphi tutorials, even a Lazarus book (which won't tell you this particular issue though), a Lazarus online free book by motaz (search the forum).
Regards,
BigChimp