Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1414
  • 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

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

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