Thank you. I really appreciate your help. The information you provided worked very well.
David C. Gideon Controller/Treasurer Builders Supply, Inc. 8198 E 44th St. Tulsa, OK 74145 PH: 918-628-1211 Fax: 918-627-3710 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak Memon Sent: Monday, February 02, 2015 2:57 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: How do I create a variable to replace a DBcalcin the F0 break in areport? At 03:38 PM 2/2/2015, David Gideon wrote: >I have a report that subtotals each project's contract amounts >and invoiced amounts using DB calc. I need to divide the total >for invoices amounts by the total for contract amounts at the >project level. According to the help menu, I cannot use the db >calc amounts to do this. I need a variable for the sum of the >contract amounts and one for the invoice amounts. I am sure >there is an easy way to create these variables but I can't get >there. > >I have tried sum(contract) and it gives me an error msg. I >tried (contract) and it only gives me the last row's amount. > >I would appreciate any help you can give me. David, Here's how (just an example to understand the technique): 01. Assign a ComponentID to the first DBCalc control, such as DBCalc1 02. Assign a ComponentID to the second DBCalc control, such as DBCalc2 03. Place a Label Object to show results and assign a ComponentID to the Label object, such as Difference 04. On appropriate band, define the following code as "Before Generate Custom EEP" -- Band Before Generate Custom EEP CLEAR VARIABLE vDBCalc1Txt,vDBCalc1,vDBCalc2Txt,vDBCalc2,vDifference SET VARIABLE vDBCalc1Txt TEXT = NULL SET VARIABLE vDBCalc1 CURRENCY = 0.00 SET VARIABLE vDBCalc2Txt TEXT = NULL SET VARIABLE vDBCalc2 CURRENCY = 0.00 SET VARIABLE vDifference CURRENCY = 00.00 GETPROPERTY DBCalc1 VALUE vDBCalc1Txt GETPROPERTY DBCalc2 VALUE vDBCalc2Txt SET VARIABLE vDBCalc1 = (FLOAT(.vDBCalc1Txt)) SET VARIABLE vDBCalc2 = (FLOAT(.vDBCalc2Txt)) SET VARIABLE vDifference = (.vDBClac1 - .vDBCalc2) PROPERTY Difference CAPTION .vDifference RETURN That's all there is to it! Hope that provides you with some ideas on how to accomplish your goal. Feel free to reach out to me if you need a sample report to illustrate the use of such technique in reports. Very Best R:egards, Razzak. www.rbase.com www.facebook.com/rbase -- 32 years of continuous innovation! 17 Years of R:BASE Technologies, Inc. making R:BASE what it is today! -- --- RBASE-L ================================================ TO POST A MESSAGE TO ALL MEMBERS: Send a plain text email to [email protected] (Don't use any of these words as your Subject: INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH, REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP) ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: INTRO ================================================ TO UNSUBSCRIBE: Send a plain text email to [email protected] In the message SUBJECT, put just one word: UNSUBSCRIBE ================================================ TO SEARCH ARCHIVES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: SEARCH-n (where n is the number of days). In the message body, place any text to search for. ================================================

