5 Replies Latest reply: Mar 12, 2012 6:55 AM by Chris Hopkins RSS

    Where Exists problem

    Chris Hopkins

      Hi, i have the following script..

       

       

      SET cFileName = $(vcGlobalQVD)CapperCalender.QVD;
      IF FileTime('$(cFileName)') >= 0 THEN 
          CapperCalender:
          LOAD Cal_Year, 
               Cal_Period, 
              Cal_Week, 
               Cal_YearDay, 
               Cal_Date AS TradingDate, 
               Cal_CurrentEPOSYear, 
               Cal_CurrentEPOSWeek, 
               Cal_CurrentYear, 
               Cal_LastYear, 
               Cal_CurrentWeek, 
               Cal_LastWeek, 
               Cal_CurrentPeriod, 
               Cal_LastPeriod, 
               Cal_ThisYTD, 
               Cal_DayCount, 
               Cal_WeekCount, 
               Cal_PeriodCount, 
               [Cal_Year-Week], 
               [Cal_Year-Period]
           
          FROM $(cFileName) (qvd) WHERE Date(Cal_Date) >= Date(Today() -70);
      ENDIF
      
      SET cFileName = $(vcRetailQVD)POSTransactionHeader_*.QVD;
      IF FileTime('$(cFileName)') >= 0 THEN
        POSTransactionHeader:
      LOAD StoreNumber, 
           TransId, 
           //TransStartDate, 
           TransStartTime, 
           EmployeeId, 
           TillNo, 
           TransStatus, 
           OverallDiscount, 
           Nolines, 
           TradingDate, 
           ZreadRef, 
           TrainingMode, 
           TrainerId, 
           %LkStoreTransID, 
           %lkStoreEmployee
      FROM $(cFileName) (qvd)WHERE Exists (TradingDate);
      ENDIF
      
      It doesn't seem to load any data in...
      
       
       The WHERE in the first part is supposed to only load in calender dates for a rolling 70 period.
       
       Then the WHERE EXISTS in the 2nd part is supposed to only load in data for the dates that are in the calender..
       
       
       But it loads no data in and i am now lost...
       
       Can anyone help please?
       
       Thanks
       
       Chris