Solved

Select Distinct day from a Datetime field

Posted on 2003-11-25
4
1,408 Views
Last Modified: 2012-06-22
Hi all.
Can anybody please help I am having trouble selecting distinct days from a datetime field.
I can do it in access ie.
SELECT DISTINCT Format([fldLogTime],"dd/mm/yyyy") AS [Date] FROM tblLog;
but can anyone please convert this to SQL for me.
Thanks
Dean.
0
Comment
Question by:Dwhite
[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
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Dishan Fernando earned 500 total points
ID: 9816495
SELECT
DISTINCT CONVERT(varchar(10), fldLogTime ,103)  AS [Date]
FROM tblLog
0
 
LVL 8

Expert Comment

by:Dishan Fernando
ID: 9816510
OR try this ..

SELECT CONVERT(varchar(10), fldLogTime ,103)  AS [Date]
FROM tblLog
GROUP BY CONVERT(varchar(10), fldLogTime ,103)
0
 

Author Comment

by:Dwhite
ID: 9816523
Thanks a lot
0
 

Author Comment

by:Dwhite
ID: 9816525
Thanks a lot
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

733 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