• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1422
  • Last Modified:

Select Distinct day from a Datetime field

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
Dwhite
Asked:
Dwhite
  • 2
  • 2
1 Solution
 
Dishan FernandoSoftware Engineer / DBACommented:
SELECT
DISTINCT CONVERT(varchar(10), fldLogTime ,103)  AS [Date]
FROM tblLog
0
 
Dishan FernandoSoftware Engineer / DBACommented:
OR try this ..

SELECT CONVERT(varchar(10), fldLogTime ,103)  AS [Date]
FROM tblLog
GROUP BY CONVERT(varchar(10), fldLogTime ,103)
0
 
DwhiteAuthor Commented:
Thanks a lot
0
 
DwhiteAuthor Commented:
Thanks a lot
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now