Having a hard time with Multi - SQL Query's..

Results 1 to 2 of 2

Thread: Having a hard time with Multi - SQL Query's..

  1. #1
    Join Date
    Dec 1969

    Default Having a hard time with Multi - SQL Query's..

    Hello,<BR> I would like to begin by thanking you for reading this question. Maybe you can shed some light on my problem?<BR><BR>I&#039;m using an Access 2000 to store my records in.<BR> fields: name,memo,date<BR><BR>Data:<BR>john, mr.smith called, 10/02/01<BR>john, have a meeting at 5pm, 10/02/01<BR>jane.......ect.<BR>jane.......ect.<BR><BR>Tr ying to Achieve the following results to no success :o(<BR><BR>a query in ASP to display by a certain date(10/02/01) and count how many memos left that day. <BR>While only display the name once on the output in a html table.<BR> <BR> Name: MemoCount: Date:<BR> JOHN 2 10/02/01<BR> JANE 6 10/02/01<BR>And so on until rs.eof<BR><BR>So if your a person that eats sleeps and breaths ASP and can help solve my dilemma with ease. Please feel free to give your coding input, helping me from pulling any more hair out.. thanks! :o)<BR>

  2. #2
    Join Date
    Dec 1969

    Default Pretty easy...

    ...but not an ASP question, at all. Just good old SQL.<BR><BR>SELECT Name, [Date], Count(*) AS MemoCount FROM table <BR>WHERE [Date] = #10/02/01#<BR>GROUP BY Name, [Date]<BR>ORDER BY Name, [Date]<BR><BR>Notice that I had to put [...] around the field you called "Date" because that is a keyword in Access SQL (and in many other SQLs). May I suggest you change the field name?<BR><BR>Anyway, GROUP BY is the secret.<BR><BR>That groups each "set" of records that have the same Name and [Date] field value and then the Count(*) counts the members of each set.<BR><BR>

Posting Permissions

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