How do I select Max number of Field From Record??

Results 1 to 2 of 2

Thread: How do I select Max number of Field From Record??

  1. #1
    Join Date
    Dec 1969
    Posts
    12

    Default How do I select Max number of Field From Record??

    Please let me know how I would retreive the maximum record for say: If my field name is browser, and it takes the browser names from visitors to a web page..so in this filed there are numerous records such as a number of MSIE and a number of Netscape ..I just want to find out the most used Browser ..??<BR><BR>Also, I have a field named day. It contains the day of Date. Every record is a hit. Thereford I want to find out the total number of days, not total number of hits/records..I know that already, just number of days.<BR><BR>Thanks :-)<BR>Rory

  2. #2
    Shawn Clabough Guest

    Default RE: How do I select Max number of Field From Record??

    For the most occuring browser:<BR>1) Open Database<BR>2) SELECT Count(Browser) AS CountOfBrowser, Browser FROM Table1 GROUP BY Browser ORDER BY Count(Browser) DESC<BR>3) rs.MoveFirst<BR>4) MostOccuringBrowser = rs.Fields("Browser")<BR><BR>Note: This actually returns a recordset with the count of browsers in descending order, so the first record is the most common browser.<BR><BR>For the days (assuming you want the count of hits by day):<BR>1) Open Database<BR>2) SELECT Count(Day) AS CountOfDay, Day FROM Table1<BR>GROUP BY Day<BR>3) Returns a recordset with fields "CountOfDay" and "Day" where "CountOfDay" = # of records for that day.<BR><BR>Hope this helps.

Posting Permissions

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