Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. query to count orders for particular date disp by datewise

query to count orders for particular date disp by datewise

Scheduled Pinned Locked Moved Database
databasehelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nareshss
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • N nareshss

      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

      _ Offline
      _ Offline
      _Damian S_
      wrote on last edited by
      #2

      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...

      N 1 Reply Last reply
      0
      • _ _Damian S_

        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...

        N Offline
        N Offline
        nareshss
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • N nareshss

          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

          S Offline
          S Offline
          shally_79
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups