Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6635763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:05:47+00:00 2026-05-25T23:05:47+00:00

I always seem to trip myself up during these types of SQL Statements. Here

  • 0

I always seem to trip myself up during these types of SQL Statements. Here is what I’m attempting to accomplish.

My Example Table

Name    Date    Type
Bob     9/28/11 1
Bob     9/27/11 1
Bob     9/28/11 2
Debra   9/28/11 1

I’m trying to write a SQL Statement that would give me all the names, their total count occured, and then a Date Filter. I’ll write a rought statement with completely wrong syntax, but I think it’ll convey what I’m attempting to do…I think.

SELECT Name, Count(*) As Total
FROM Table
GROUP BY Name, Total
WHERE Date = Today (I'm aware you can't do a WHERE in a GROUP BY) AND Type = 1

Essentially, I would like to get back a set of data that would show the Name, how many instances of Type 1 for today.

I don’t think I’m searching for the proper question to actually be able to effectively research this on my own as well, probably because I’m wording it improperly.

Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:05:48+00:00Added an answer on May 25, 2026 at 11:05 pm

    Your WHERE was in the wrong place:

    SELECT Name, Count(*) As Total
    FROM Table
    WHERE Date = Today AND Type = 1
    GROUP BY Name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a conceptual model seem like each entity always correspond to one table in
Here is some sample code...I always seem to get a ClassCastException...anybody point out what
WiX files always seem to include this line: <Directory Id=TARGETDIR Name=SourceDir> What is SourceDir?
I always seem to get caught up in multiple joins. I have these tables
I always seem to be having fun working with the Ax 2009 product until
I'm trying to pass a string to chdir(). But I always seem to have
I've seen examples for load() and ready() , but they always seem to apply
I've been struggling with how to structure my 3-tier applications. I always seem to
In WinForms, to set focus to a specific control, I always seem to wind
I seem to be getting this particular always when i am trying to receive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.