Predmet:Re: Problem Petlja
vjerojatno sam bio nejasan...
ovdje su definirane,u jednom drugom modelu:
Option Compare Database
Option Explicit
Public PintFlag As Integer
Public Ppartner, psifradoc, Pkonto As String
Public Pproizvod As String
Public PBFR As Long
Public Psifra As String
Public Pprinter As String
Public Pkolicina As String
Public strSQL As String
Public pocetni
Public krajnji
Public zadan
Public Pjmbg As String
Public strPay, strRok, strKup As String
Public strFioka As String
Public strDebSlova, strObSlova, strRezi, strPomjeri, strParPrint, strP, strIzbTrake As String
Public strRadnik As String
Public strSmjena As String
Public rab As Double
Public Dalje As Boolean
Public ResetBr As Boolean
Public strReset As String
Public strmasno As String
Public strduplo, VELIKO, MALO, MASNO, NEMASNO, DUPLO, NORMALNO As String
'veliko = Chr(27) & " " + Chr(1) + Chr(27) & "w" + Chr(1)
'malo = Chr(27) & "W" + Chr(0) + Chr(27) & "w" + Chr(0)
'masno = Chr(27) & "E"
'nemasno = Chr(27) & "F"
'duplo = Chr(27) & ""
'normalno = Chr(27) & "H"
'/////////////////////////
kada idem dalje...
sve pozivam iz Qzaperiod1
Set rst = CurrentDb.OpenRecordset("select * from Qzaperiod1 WHERE datum BETWEEN DATEVALUE('" & pocetni & "') AND DATEVALUE('" & krajnji & "')")
rst.MoveFirst
Datum = rst!Datum
Do Until rst.EOF
sif = rst!proizvod
im = rst!ime
izn = rst!SumOfiznos
Print #1, Format(rst!Datum, "dd.mm.yyyy"); " "; sif; Tab(16); right(im, 24); Tab(41 - Len(Format(izn, "###0.00"))); Format(izn, "###0.00")
' siznos = siznos + rst!SumOfiznos
rst.MoveNext
Loop
Print #1, "----------------------------------------"
i dobijem...
04.05.2016 56 RadnaTaksa 14.00
04.05.2016 56erad.txt e_recept 22.00
05.05.2016 55 participacija 2.00
05.05.2016 56 RadnaTaksa 8.00
05.05.2016 56erad.txt e_recept 34.00
06.05.2016 56 RadnaTaksa 11.00
06.05.2016 56erad.txt e_recept 47.00
i sve se odigra dobro u smislu da za svaki datum donese obe vrste takse.
i sad je problem npr poslije 04.05.2016 trebalo bi obe vrste sabrati pa da
bude 04.05.2016 ukupno 36, ja sam to napravio ovako
Print #1, "----------------------------------------"
Set rst = CurrentDb.OpenRecordset("select * from Qzaperiod2 WHERE datum BETWEEN DATEVALUE('" & pocetni & "') AND DATEVALUE('" & krajnji & "')")
izn = 0
Suma = 0
rst.MoveFirst
Datum = rst!Datum
Do Until rst.EOF
izn = rst!SumOfiznos
Print #1, Format(rst!Datum, "dd.mm.yyyy"); Tab(41 - Len(Format(izn, "###0.00"))); Format(izn, "###0.00")
rst.MoveNext
Loop
Print #1, "----------------------------------------"
rst.MoveFirst
Do Until rst.EOF
Suma = Suma + rst!SumOfiznos
rst.MoveNext
Loop
rst.MoveFirst
Print #1, "SVEUKUPNO : "; Tab(41 - Len(Format(Suma, "####0.00"))); Format(Suma, "####0.00"); " KM"
Print #1, "----------------------------------------"
Print #1, Chr(27) & Chr(100) & Chr(8)
Print #1, Chr(27) & Chr(105)
Close #1
...
i narvano to nije ono sto ja hocu
zaptravo imam dva niza
prvi
04.05.2016 56 RadnaTaksa 14.00
04.05.2016 56erad.txt e_recept 22.00
05.05.2016 55 participacija 2.00
05.05.2016 56 RadnaTaksa 8.00
05.05.2016 56erad.txt e_recept 34.00
06.05.2016 56 RadnaTaksa 11.00
06.05.2016 56erad.txt e_recept 47.00
drugi
04.05.2016 36.00
05.05.2016 44.00
06.05.2016 58.00
a trebalo bi biti samo jedan
04.05.2016 56 RadnaTaksa 14.00
04.05.2016 56erad.txt e_recept 22.00
...
04.05.2016 36.00
nadam se da sam malo pojasnio
pozdrav