query to count orders for particular date disp by datewise
-
Hiiii... all.... I have a table called "orders" .. In that table ive some orderslist for particular dates ... then r not in certain order ... now i want to count the records stored in particular date , and i want to display only the "date and total orders ( count ) done in that particular date ... .............. like , Date TotalOrders(Count) 1/5/2007 50 2/5/2007 45 3/5/2007 80 LIke this ... plz help me Thanks in adv Naresh
-
Hiiii... all.... I have a table called "orders" .. In that table ive some orderslist for particular dates ... then r not in certain order ... now i want to count the records stored in particular date , and i want to display only the "date and total orders ( count ) done in that particular date ... .............. like , Date TotalOrders(Count) 1/5/2007 50 2/5/2007 45 3/5/2007 80 LIke this ... plz help me Thanks in adv Naresh
select OrderDate, count(OrderID) from tblOrder where OrderDate between '2007-01-01' and '2007-03-31' group by OrderDate ---------------------------------------------- Damian - still with no useful signature...
-
select OrderDate, count(OrderID) from tblOrder where OrderDate between '2007-01-01' and '2007-03-31' group by OrderDate ---------------------------------------------- Damian - still with no useful signature...
Hi Thanks Alot but iam not getting result exactly .... I think the problem is with the time .... iam having datetime not only date ... I tried like this select orcvddatetime, count(OurORef) from ordermain group by orcvddatetime Now am getting the count but its depends on time, i need the result based on date , now my query is --------- select orcvddatetime, count(OurORef) from ordermain where orcvddatetime between '2007-03-12 10:07:00' and '2007-02-13 06:07:00' group by orcvddatetime --------- but iam getting empty data it is showing like this >>>> orcvddatetime (No column Name) Its empty... i dont kw the reason ... my column names r correct n the some is also there in my table ordermain Actually am new to this environment ... plz help me ... Thanks in advance naresh
-
Hi Thanks Alot but iam not getting result exactly .... I think the problem is with the time .... iam having datetime not only date ... I tried like this select orcvddatetime, count(OurORef) from ordermain group by orcvddatetime Now am getting the count but its depends on time, i need the result based on date , now my query is --------- select orcvddatetime, count(OurORef) from ordermain where orcvddatetime between '2007-03-12 10:07:00' and '2007-02-13 06:07:00' group by orcvddatetime --------- but iam getting empty data it is showing like this >>>> orcvddatetime (No column Name) Its empty... i dont kw the reason ... my column names r correct n the some is also there in my table ordermain Actually am new to this environment ... plz help me ... Thanks in advance naresh
try to use convert function to extract date from ur field select count(*) as [No Of Orders],convert(varchar,CreatedDate,103) as OrderedDate from inv_drugorder where convert(varchar,CreatedDate,103)='11/05/2007' group by convert(varchar,CreatedDate,103) if it is not working or showing some errors pls mail me:)
sdf