suma() columna con fecha actual

suma() columna con fecha actual

joseninobjoseninob Posts: 2Questions: 2Answers: 0
edited October 2021 in General

Logre sumar los datos de mi columna precio, pero me gustaría saber como puedo colocar la condición de que me sume los registros de la columna precio con la fecha actual del dia y no el total de la columna gradecería mucho su ayuda.

<script>
$(document).ready(function(row,data,index) {
     var tabla = $('#casillero').DataTable( {
        dom: 'Bfrltip',
        buttons: [
             {
                extend:    'copyHtml5',
                text:      '<i class="fa fa-files-o">Copy</i>',
                titleAttr: 'Copy',
                className: 'btn btn-primary'
            },
            {
                extend:    'excelHtml5',
                text:      '<i class="fa fa-file-excel-o">excel</i>',
                titleAttr: 'Excel',
                className: 'btn btn-success'
            },
            {
                extend:    'pdfHtml5',
                text:      '<i class="fa fa-file-pdf-o">pdf</i>',
                titleAttr: 'PDF',
                className: 'btn btn-danger'
            }
        ],

    } );
    var total = tabla.column(7).data().sum();
        $("#total").text(total);
} );
</script>

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.