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

  • Home
  • SEARCH
  • 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 7563371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:39:01+00:00 2026-05-30T13:39:01+00:00

Date Format Problem: I just want date – no time. SQL statement: SELECT SubjectIndex,

  • 0

Date Format

enter image description here

Problem: I just want date – no time.

SQL statement:

SELECT SubjectIndex, LetterNo, DateOfIssue 
FROM [CircularKeeper]  
ORDER BY DateOfIssue DESC

After removing the time part I want it to be ordered descending.

I am binding the data using a SqlDataSource to a listsview and displaying the date in a label control.

  • 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-30T13:39:02+00:00Added an answer on May 30, 2026 at 1:39 pm

    You can do it a number of ways, in 2008 I’d go with:

    SELECT SubjectIndex,LetterNo, CAST(DateOfIssue AS DATE) AS DateOfIssue
    FROM [CircularKeeper]  
    ORDER BY DateOfIssue DESC
    

    As there is now a DATE data type – if you don’t actually store times in that field in the table, then you might want to consider changing the datatype from DATETIME to DATE instead – saves the CASTing like this and uses less space (3 bytes instead of 8).

    You could also just do this in the UI by returning the DATETIME as you currently are, and making sure you format the dates appropriately before rendering.

    Update:
    I would recommend returning the DATE as a DATE from the query – so return the data in it’s strongly typed form. If for presentation purposes you need it formatted a certain way, I’d recommend applying the formatting in your presentation logic.

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

Sidebar

Related Questions

My problem is that I receive for example a date in a concatenated format:
I have a Date format: 2009-08-10T16:03:03Z that I want to convert to: @MMM dd,
Here's the problem I'm trying to solve. I want to pass a date, then
I have a String to Date conversion problem using SQL Bulkcopy in asp.net 3.5
I have a birth_date variable in the Date format. I want to compare it
I am trying to select rows which are within a certain time period: $sql
I want to check if a date has a correct format. There is many
I am having a problem adjusting this part of my SQL statement: HAVING dbo.BOOKINGS.BOOKED
What is the best (date format independent way) in PHP to calculate difference in
Does anybody know which date format is to be used, trying to create a

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.