
Getting SQL Sum() in VB 3.0
Quote:
>Dear all,
>I am pretty new in VB and have just encountered a problem. I have the
>following code in my program module :
>sqlq1="SELECT Sum(Cost) FROM MONEY_ALLOCATION WHERE MONEY_ALLOCATION.Dept_Code='40'"
>set Qry1=createdynaset(sqlq1)
>Okay, my problem is how can I display the "Sum(Cost)" from Qry1?
Don't hold me to this, but I think you need to add this....
sqlq1="SELECT Sum(Cost) As BIGBUCKS FROM MONEY_ALLOCATION WHERE
MONEY_ALLOCATION.Dept_Code='40'"
set Qry1 = DB.CreateDynaset(sqlq1)
Text1.Text = Qry1("BIGBUCKS")
Ed Phillippe
Quote:
>Thank you all for the helping hand!
>Best regards,
>Ben
********************************************************
** Southern Indiana Bass Fishing / Outdoor Software **
** HTTP://www.evansville.net/~dlion/mypage.htm **
********************************************************