Topic: Final MVD 4.6, 4.7

Hi,

Can I get the new features from version 4.6 & the 4.7 beta

Regards, спасибо

Pierre P

Re: Final MVD 4.6, 4.7

Hello.

4.6
- quick search for functions and classes
- added support TIFF format for DBImage
- added functions: GetIPAddress, GetCursorPos, KillTask, PostMessage
- other minor changes
- fixed some errors



4.7
- Just minor things

Dmitry.

Re: Final MVD 4.6, 4.7

Hi,

Version 4.6 & 4.7 seem to have a bug with SQL query on date filter.

In your example invoice you can test it

If you try this SQL query in the button search instead of search 'function' the following code is not function correctly



select Date,lastname,firstname
                                                                       
FROM clients                                                             
where  date(Date) >= {dtDate}


If you press the button search on form1 & the date is 2018-09-18 checked on datepicker the data with the date = 2018-09-18 is NOT Show.
If we set date for 2018-09-17, we can see data .

Version MVD 4.5 was OK

Regards,  спасибо

Pierre P

Re: Final MVD 4.6, 4.7

try in this way

select Date,lastname,firstname
                                                                        
FROM clients                                                             
where  date(Date) >= date({dtDate})
Dmitry.

Re: Final MVD 4.6, 4.7

Hi,

I try but still the same problem


Pierre P

Regards,  спасибо

Re: Final MVD 4.6, 4.7

I have checked, it works

where  date(Date) >= date({dtDate})
Dmitry.

Re: Final MVD 4.6, 4.7

OK, was my mistake

I  wrote where  date(Date) >= ({dtDate}) !!! missing Date in front of ({dtDate})

where  date(Date) >= date({dtDate}) OK

Great job Dmitry.

Sorry ,

извините

MVD is very great compiler !!! MVD очень большой компилятор

PierreP

Re: Final MVD 4.6, 4.7

Hello MVD community. I use the procedure below to generate a report. Works well. I use dtIni and dtFim to put the period in the report title. Is it possible to simplify this comparison (> =, <=) with dates?

Or is there another way to put the query date range in the report header?

procedure frmListVendas_bRelVendas_OnClick (Sender: string; var Cancel: boolean);
//****** alimenta relatório padrão lista de vendas a partir do tablegrid
var
    i,c: integer;
    s, YY, MM, DD: string;
    Y,M,D: Word;
    v_dtini, v_dtfim: string;
begin
    s := '';
    DecodeDate(frmListVendas.dtIni.Date, Y, M, D);
    YY := vartostr(Y); MM :=vartostr(M); DD := vartostr(D);
    if length(MM) = 1 then MM := '0'+MM; if length(DD) = 1 then DD := '0'+DD;
    v_dtini := YY+'-'+MM+'-'+DD;   showmessage(v_dtini);
    DecodeDate(frmListVendas.dtFim.Date, Y, M, D);
    YY := vartostr(Y); MM :=vartostr(M); DD := vartostr(D);
    if length(MM) = 1 then MM := '0'+MM; if length(DD) = 1 then DD := '0'+DD;
    v_dtfim := YY+'-'+MM+'-'+DD; showmessage(v_dtfim);
    frmListVendas.bRelVendas.dbSQL := '';
    frmListVendas.bRelVendas.dbSQL := 'SELECT   "Vendas"."Nota_Fiscal", "Vendas"."Pedido", '+
'         strftime("%d-%m-%Y","Vendas"."Data_Venda") as Data_Venda, '+
'         (SELECT strftime("%d-%m-%Y",Min("Vendas"."Data_Venda")) from Vendas where Data_Venda >= '+v_dtini+') as DtIni,'+
'         (SELECT strftime("%d-%m-%Y",Max("Vendas"."Data_Venda")) from Vendas where Data_Venda <= '+v_dtfim+') as DtFim,'+
'         "Clientes"."Clie_Nome", '+
'         "Vendedores"."Vend_Nome", '+
'         "Vendas"."Quantidade", '+
'         "Vendas"."Valor"  '+
'FROM     "Vendas"  '+
'LEFT OUTER JOIN "Clientes"  ON "Vendas"."id_Clientes" = "Clientes"."id" '+
'LEFT OUTER JOIN "Vendedores"  ON "Vendas"."id_Vendedores" = "Vendedores"."id" ';

    c := frmListVendas.TableGrid_Vendas.RowCount-1;

    for i := 0 to c do
    begin
        s := s + ''+IntToStr(frmListVendas.TableGrid_Vendas.dbIndexToID(i)) + ',';
    end;

    if s <> '' then
    begin
        SetLength(s, Length(s)-1);
        //showmessage(s);
        frmListVendas.bRelVendas.dbSQL := frmListVendas.bRelVendas.dbSQL + ' WHERE Vendas.id IN (' + s +') ORDER BY Data_Venda';
    end;
    if (frmListVendas.TableGrid_Vendas.RowCount-1) = -1 then cancel := True;
end;

Roberto Alencar