Subject |
Re: Calculated field and Query |
From |
Dirk <test@test.com> |
Date |
Mon, 10 Dec 2018 13:26:53 +0100 |
Newsgroups |
dbase.getting-started |
Op 9/12/2018 om 20:27 schreef Tim Ward:
> On 09/12/2018 17:28, Dirk wrote:
>> i tried to put the calculated fields among the other fields in the sql
>> to get thes on the excel file, but :) not in the table not in the sql
>> so i am more and more thinking how to get the calculated fields on the
>> right place in the excel file;
>> so suppose is a matter to find a way in excel
> Hi Dirk,
>
> How are you sending/importing the data into Excel from your query?
>
> Tim
Tim
first i used the excel way :
this is just a part of it
oExcel.range("h10").select()
oExcel.ActiveCell.FormulaR1C1 = "kostprijs"
oExcel.range("i10").select()
oExcel.ActiveCell.FormulaR1C1 = "totale kostprijs"
oExcel.range("h11").select()
oExcel.ActiveCell.FormulaR1C1 = rf["kost"].value
oExcel.range("i12").select()
oExcel.ActiveCell.FormulaR1C1 = rf["totaalkost"].value calculated
field
on this way could ( with the calculated fields) created an excel file,
but not loop :: only the first row
afterwards to have ready this progr i puted records in the table instead
of calculated files
now : nrij =11
rc.first()
do while not rc.EndofSet
nRij++
for nKol = 2 to (rf.size-6)
xValue = rf[nKol].value
oCell= oExcel.activeSheet.Cells(nrij,nKol)
ocell.formulaR1C1 = "'" + (xValue)
next
rc.next()
enddo
//oExcel.ActiveSheet.Columns.AutoFit()
oExcel =null
form.rowset.refreshControls( )
return
with sql sql = ("select
volgnr,datum,aardkosten,verschil,eenheidsprijs,totaalkost,eenheidvast,kostvast,totalekost,einde,rekeninguit,
rekeningin,datumbetaaldklant,aanvang,datumbetaaldprive from kilometer")
so i have to find a way to loop the info
thanks
Dirk
|
|