Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

delphi parameter problem

Posted on 2009-02-16
3
Medium Priority
?
232 Views
Last Modified: 2013-11-23
HI,

I would like to pas a SELECT SUM in ADOQuery to a resultant parameter as follows

SELECT SUM(Price) AS Total FROM CashDesk

But I would like to pass the Total as a parameter then to an edit box.

can any one help, sorry this isnt very clear.
0
Comment
Question by:DaveAM
  • 2
3 Comments
 
LVL 14

Expert Comment

by:SteveBay
ID: 23655289
Yes, not very clear.
Typically, you would open your ADOQuery and then assign the value something like this
Edit1.Text := ADOQuery1.FieldByName('Total').AsFloat;
0
 
LVL 14

Accepted Solution

by:
SteveBay earned 1200 total points
ID: 23655308
Sorry about that. You need to convert to string.
either
Edit1.Text := FloatToStr( ADOQuery1.FieldByName('Total').AsFloat);
or
Edit1.Text := ADOQuery1.FieldByName('Total').AsString;
0
 
LVL 22

Assisted Solution

by:senad
senad earned 800 total points
ID: 23661306
AfterOpen of the ADOQuery;
Edit1.Text := ADOQuery1.FieldByName('Total').AsString;
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question