Hi,
I have a datetime column named dtDateTime.
its format is "Oct 27 2006 12:00:00 "
I want to group by only date part of it and count
my code is
$sql1="SELECT convert(varchar ,J1708Data.dtDa teTime,120),
count(convert(v archar,J1708Dat a.dtDateTime,12 0))
FROM Vehicle INNER JOIN J1708Data ON Vehicle.iID = J1708Data.iVehi cleId
WHERE (J1708Data.iPid Id = 303) AND
(J1708Date.dtDa teTime between '2006-10-25' AND '2006-10-28')
AND (Vehicle.sDescr iption = $VehicleID)
GROUP BY convert(varchar ,J1708Data.dtDa teTime,120)";
However, convert part, group by part doesnt' work at all.
(i couldn't check count part)
can you find where's the problem?
Thx.
I have a datetime column named dtDateTime.
its format is "Oct 27 2006 12:00:00 "
I want to group by only date part of it and count
my code is
$sql1="SELECT convert(varchar ,J1708Data.dtDa teTime,120),
count(convert(v archar,J1708Dat a.dtDateTime,12 0))
FROM Vehicle INNER JOIN J1708Data ON Vehicle.iID = J1708Data.iVehi cleId
WHERE (J1708Data.iPid Id = 303) AND
(J1708Date.dtDa teTime between '2006-10-25' AND '2006-10-28')
AND (Vehicle.sDescr iption = $VehicleID)
GROUP BY convert(varchar ,J1708Data.dtDa teTime,120)";
However, convert part, group by part doesnt' work at all.
(i couldn't check count part)
can you find where's the problem?
Thx.
Comment