Nel

Nel

  • NA
  • 716
  • 1.1m

Problem with the select statement in the crystal Report

Nov 16 2011 3:57 AM
Hello,

I have this code for the select statement in my CrystalReport.

SELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov,Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM,(Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA,  MAGACIN.KOL AS Gorivo, (MAGACIN.KOL)/100 AS Potr100km, MAGACIN.KOL as Maslo
FROM (NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR
where ( ( ( (NOVI.GBR)>=? And (NOVI.GBR)<=? ) ) AND (   (NOVI.AB)=?   or  (NOVI.AB)=?) AND ( ( (NALOG1.DATA)>=?) and ((NALOG1.DATA)<=?) )AND ((MAGACIN.SIFRA)=?) AND ( (MAGACIN.SIFRA)=? or (MAGACIN.SIFRA)=?) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, MAGACIN.KOL

When I don't write the bold parts from it, it functions fine, it displays the table, but when I write the bold parts which I need as column, the dataset appears to be empty and the report is empty. How to define different columns for different values of the field KOL, dependig on the value in field SIFRA?

I would appreciate your help a lot.