14 Replies Latest reply: Dec 16, 2016 1:52 PM by MARIO SOARES RSS

    Date(Floor)  Oracle está com erro.

    Agnaldo Neves

      Alguma Dica.



      LET vHoje = Today();
      LET vVencimento = Date(Today()-30,'DD/MM/YYY');
      LET vDateMax= Floor(MonthEnd(Today()));
      LET vDateMin= num(MakeDate(2013,01,01));


      Calenderio:
      LOAD
      Distinct
      Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY') AS CalendarDate,
      ceil(Month(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY'))/3) & 'Trim' as Trimestre,
      month(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY')) AS Mês,
      WeekDay(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY')) AS Semana,
      Day(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY')) AS Dia,
      year(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY')) AS Ano,
      monthname(Date($(vDateMin) + RowNo() - 1,'DD-MMM-YYYY')) AS MesAno

      AutoGenerate 1 While $(vDateMin) + IterNo() - 1 <=$(vDateMax);
      store Calenderio into C:\Geral\qvd\Calenderio.qvd(qvd);

      Let v_data = '2016-12-11'; ;
      Let v_dataf = '2017-01-01';

      CUSTOM CONNECT TO "Provider=QvOdbcConnectorPackage.exe;driver=oracle;host=192.168.0.105;port=1521;servicename=f3ipro;EnableNcharSupport=1;XUserId=PIDNDTdNDbYeWPNMPTbGXaRNULYIK;XPassword=EQeDOYFMTbcOXXJOELJETRdNObcKHWROBbMSGYAHFJMYG;";

      [VPEDIDOS_VENDA]:
      SELECT "EMPR_ID",
      "COD_EMP",
      "RAZAO_SOCIAL",
      "PDV_ID",
      "NUM_PEDIDO",
      "SIT_PDV_FIN",
      "SIT_PDV_COM",
      "SIT_PDV",
      "POS_PDV",
      "TIPO",
      "DT_EMIS",
      "DT_ENTREGA",
      Date(Floor(DT_ENTREGA),'DD/MM/YYYY') as CalendarDate,
      "CLI_ID",
      "COD_CLI",
      "DESC_CLI",
      "ATIVO_CLI",
      "EST_ID_FAT",
      "EST_ID_ENTR",
      "EST_ID_CBR",
      "REP_ID",
      "CNPJ_EST_FAT",
      "DIVD_ID",
      "COD_DIVD",
      "DESC_DIVD",
      "TPRVEN_ID",
      "COD_TPRVEN",
      "DESC_TPRVEN",
      "ORDEM_CPR",
      "CDPG_ID",
      "COD_CDPG",
      "DESC_CDPG",
      "NUM_PED_REPR",
      "SERIE_NF",
      "NUM_NF",
      "DT_EMIS_NF",
      "FORN_ID",
      "COD_FOR",
      "DESC_FOR",
      "TP_FRETE",
      "FORN_ID_RDP",
      "COD_FOR_RDP",
      "DESC_FOR_RDP",
      "TP_FRETE_RDP",
      "VLR_BRUTO",
      "VLR_DESC_PDV",
      "VLR_ACRES_PDV",
      "VLR_LIQ",
      "VLR_IPI",
      "VLR_LIQ_IPI",
      "VLR_LIQ_SICMS",
      "VLR_BRUTO_SICMS"
      FROM
      "FOCCO3I"."VPEDIDOS_VENDA"
      WHERE DT_EMIS>= '$(v_data)' and DT_EMIS <='$(v_dataf)';

      store VPEDIDOS_VENDA into C:\Geral\qvd\VPEDIDOS_VENDA.qvd(qvd);