Solved

Select Distinct day from a Datetime field

Posted on 2003-11-25
4
1,400 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now