Solved

How to select DISTINCT dates from a Date/Time field

Posted on 2000-04-28
2
535 Views
Last Modified: 2010-05-18
I'm trying to select distinct dates from a Date/Time field
Tried something like

SELECT DISTINCT left(myDate,11) AS dateList FROM myTable

Unfortunately, it returns the date converted to string, no good.

Any right way of doing this?

Thanks

Ion
0
Comment
Question by:iamari
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
Gustavo Perez Buenrostro earned 100 total points
ID: 2761218
Try next query and post your opinion:

select distinct convert(datetime,convert(varchar,myDate,112)) from myTable
0
 
LVL 2

Author Comment

by:iamari
ID: 2766039
Thanks a alot, works like a charm!

Ion
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question