pinstripe
Programmer
- Dec 27, 2004
- 52
Hi to all,
i know that this query might look long but i know where the problem is - i just don't know how to solve it!
This is the query for a subform. In a form footer i would like to count all records based on this given query.
In a text box control source i am useing =[Form].RecordsetClone.RecordCount
It has always gave me o.k. count, until i was forced to add this into the query bellow:
under Select - Stroski.Armotizacijaa
under From - ON Stroski.IdStroski = Prevoz.IdStroski) ON (Vozilo.IdVozilo = Stroski.IdVozila)
It still gives me a good cout accept for 0 records, count gives #ERROR not 0!
i have tried several different ways to make this work (Nz,IIF,Count(*),Val,Trim,) but with no success.I need help!
SELECT Prevoz.IdPrevoza, Prevoz.Opombe, Prevoz.[Destinacija Opis], Prevoz.Cestnina1, Prevoz.TotalCestnina, Prevoz.TotalSpedicija, Prevoz.[Valuta Spedicija1], Prevoz.[Valuta Cestnina1], Prevoz.[Valuta Cestnina2], Prevoz.[Valuta Spedicija2], Prevoz.Cestnina2, Prevoz.Spedicija1, Prevoz.Spedicija2, Prevoz.Destinacija, Prevoz.[Start Km], Prevoz.[Stop Km], Stroski.Armotizacijaa, Nastavitve.NaKm, Nastavitve.Dnevnica, Nastavitve.[Cena Za Liter], Nastavitve.Euro, Prevoz.[Skupaj Km], Prevoz.[Start Gorivo], Prevoz.[Stop Gorivo], Prevoz.NakupGoriva, Prevoz.[Skupaj Gorivo], Prevoz.[Cena Prevoza Odhod], Prevoz.[Cena Prevoza Prihod], Prevoz.[Cena Prevoza Skupaj], Prevoz.[Datum Vpisa], Prevoz.IdVozilo, Prevoz.IdVoznik, Prevoz.IdNastavitve, Prevoz.IdFirme, Stroski.IdStroski, Prevoz.[Datum Odhoda], Prevoz.DatumPrihoda, Prevoz.[Dodatek Vozniku], Podjetje.[Naziv Podjetja]
FROM Voznik INNER JOIN (Vozilo INNER JOIN (Stroski INNER JOIN (Podjetje INNER JOIN (Nastavitve INNER JOIN Prevoz ON Nastavitve.IdNastavitve = Prevoz.IdNastavitve) ON Podjetje.IdFirme = Prevoz.IdFirme) ON Stroski.IdStroski = Prevoz.IdStroski) ON (Vozilo.IdVozilo = Stroski.IdVozila) AND (Vozilo.IdVozilo = Prevoz.IdVozilo)) ON Voznik.IdVoznik = Prevoz.IdVoznik;
thx
i know that this query might look long but i know where the problem is - i just don't know how to solve it!
This is the query for a subform. In a form footer i would like to count all records based on this given query.
In a text box control source i am useing =[Form].RecordsetClone.RecordCount
It has always gave me o.k. count, until i was forced to add this into the query bellow:
under Select - Stroski.Armotizacijaa
under From - ON Stroski.IdStroski = Prevoz.IdStroski) ON (Vozilo.IdVozilo = Stroski.IdVozila)
It still gives me a good cout accept for 0 records, count gives #ERROR not 0!
i have tried several different ways to make this work (Nz,IIF,Count(*),Val,Trim,) but with no success.I need help!
SELECT Prevoz.IdPrevoza, Prevoz.Opombe, Prevoz.[Destinacija Opis], Prevoz.Cestnina1, Prevoz.TotalCestnina, Prevoz.TotalSpedicija, Prevoz.[Valuta Spedicija1], Prevoz.[Valuta Cestnina1], Prevoz.[Valuta Cestnina2], Prevoz.[Valuta Spedicija2], Prevoz.Cestnina2, Prevoz.Spedicija1, Prevoz.Spedicija2, Prevoz.Destinacija, Prevoz.[Start Km], Prevoz.[Stop Km], Stroski.Armotizacijaa, Nastavitve.NaKm, Nastavitve.Dnevnica, Nastavitve.[Cena Za Liter], Nastavitve.Euro, Prevoz.[Skupaj Km], Prevoz.[Start Gorivo], Prevoz.[Stop Gorivo], Prevoz.NakupGoriva, Prevoz.[Skupaj Gorivo], Prevoz.[Cena Prevoza Odhod], Prevoz.[Cena Prevoza Prihod], Prevoz.[Cena Prevoza Skupaj], Prevoz.[Datum Vpisa], Prevoz.IdVozilo, Prevoz.IdVoznik, Prevoz.IdNastavitve, Prevoz.IdFirme, Stroski.IdStroski, Prevoz.[Datum Odhoda], Prevoz.DatumPrihoda, Prevoz.[Dodatek Vozniku], Podjetje.[Naziv Podjetja]
FROM Voznik INNER JOIN (Vozilo INNER JOIN (Stroski INNER JOIN (Podjetje INNER JOIN (Nastavitve INNER JOIN Prevoz ON Nastavitve.IdNastavitve = Prevoz.IdNastavitve) ON Podjetje.IdFirme = Prevoz.IdFirme) ON Stroski.IdStroski = Prevoz.IdStroski) ON (Vozilo.IdVozilo = Stroski.IdVozila) AND (Vozilo.IdVozilo = Prevoz.IdVozilo)) ON Voznik.IdVoznik = Prevoz.IdVoznik;
thx