Select Count(*), tanggal as totRits And Count(*), total as tNote From tblsolar Where tanggal like '%" & sqlDate & "%' And supir like '%" & cboSupir & "%' Group By tanggal
how to select count two time
CodePudding user response:
This COUNT
function is used to find the number of indexes as returned from the query selected.
Please see the below example-
SELECT COUNT(Column1), COUNT(Column2) FROM Table;
CodePudding user response:
If you want to get the total COUNT
and a COUNT
of a specific column using different conditions, you can use a subquery like this:
SELECT
(SELECT
COUNT(tanggal) AS totRits
FROM tblsolar
WHERE tanggal LIKE '%sqlDate%'
AND supir LIKE '