Group by country, date

Results 1 to 2 of 2

Thread: Group by country, date

  1. #1
    mark Guest

    Default Group by country, date

    Hello,<BR><BR>I&#039;m trying to order my data by country and date (and vice versa) using:<BR><BR>strSQL = "SELECT Count( AS CountOfcountry,, FROM tracking GROUP BY ORDER by;"<BR><BR>(date is stored as dd-mmm-yy 20-APR-01<BR><BR>what should the sql be to get:<BR><BR>jan D 32<BR>jan GB 13<BR>feb D 13<BR>feb GB 32<BR><BR>and<BR><BR>D jan 32<BR>D feb 13<BR>GB jan 20<BR>GB feb 18<BR><BR>Thanks in advance (if anyone is reading the posts today, looks a little quiet!),<BR><BR>Mark<BR>

  2. #2
    Join Date
    Dec 1969

    Default Group by country, date: the answer

    Well I&#039;ve answered my won question, so either no-one knows or no-one cares. For anyone interested:<BR><BR>SELECT DATEPART(&#039;m&#039;, AS [Month], Count( AS CountOfcountry, country<BR>FROM tracking<BR>GROUP BY DATEPART(&#039;m&#039;, tracking.Date), country;<BR><BR>for MS-Access<BR><BR>Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts