Solved

Select Distinct day from a Datetime field

Posted on 2003-11-25
4
1,404 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
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

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

Expert Comment

by:dishanf
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

831 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