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 8249917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:42:26+00:00 2026-06-07T23:42:26+00:00

select source_of_data, convert(varchar(10),a.DATECREATED,101), COUNT(*) from some_table a group by source_of_data, convert(varchar(10),a.DATECREATED,101) order by source_of_data,

  • 0
select 
  source_of_data,
  convert(varchar(10),a.DATECREATED,101),
  COUNT(*)
from some_table a
group by
  source_of_data, 
  convert(varchar(10),a.DATECREATED,101)
order by 
  source_of_data,
  convert(varchar(10),a.DATECREATED,101)

Output data looks like this:

mainframe 4/5/11  22
mainframe 4/6/11  45
mainframe n/n/nn  nn
sqlserver 4/5/11  44
sqlserver 4/6/11  67
sqlserver n/n/nn  nn

But I want the output to look like this:

mainframe 4/5/11  22
sqlserver 4/5/11  44
mainframe 4/6/11  45
sqlserver 4/6/11  67
mainframe n/n/nn  nn
sqlserver n/n/nn  nn

This way I can easily verify visually if a grouped entry for any particular date is missing—say for some day we get mainframe data but sqlserver data is missing. Can someone please help modify the query so I don’t have to resort to writing a stored proc to achieve my objective?

  • 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-06-07T23:42:27+00:00Added an answer on June 7, 2026 at 11:42 pm

    If I understand correctly, just switch your order by to

    convert(Date, a.DATECREATED,101), source_of_data
    

    then your results should come out how you describe

    Edit: converting it to varchar, it will not work as expected. Convert it to DATE type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query which involves a table from another server: select count(serialno), max(convert(varchar(10),Crtd_DateTime,101))
the row source for a listbox looks like this: SELECT users.id, users.first, users.last, chavrusas.luser_type
SELECT Id,Date,Name FROM people WHERE DATEPART(hh,Date) >= 7 AND DATEPART(hh,Date) <= 8 Order by
well this is my problem i use 2 source first query (select * from
What's going on here? BTW, MySQL Server version: 5.0.45-log Source distribution. mysql> select count(*)
SELECT REPLACE([strUrl], '/myoldurl', '/mynewurl') FROM [UrlRewrite] If strUrl is /myoldurl/myoldurl_something_else , it returns /mynewurl/mynewurl_something_else
select tf.Id,tf.Name,tf.LName,tf.Rank,tf.Category where tf.Id not in (select fighter_id from tbl_player_fighter where league_id=91) and tf.Status
When using LINQ to get data from a list I encounter this error. How
i am using the following code to convert an excel set of data on
I want to convert a table storing in Name-Value pair data to relational form

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.