Solved

Excel date convert problem

Posted on 2008-10-07
2
409 Views
Last Modified: 2008-10-07
I have one column in excel 2007 in the format of m/d/yyyy h:mm, but I'm trying to run query to group results to days. That means I want to eliminate time for that column. What should I do ?
Although I can change the format directly to m/d/yyyy, but the query GROUP BY dates will still group results to hours.

Thanks
0
Comment
Question by:CodingCat
2 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
If the query is running in SQL Server...

SELECT CONVERT(datetime, CONVERT(varchar, DateColumn, 102)) AS TheDate, SUM(Something)
FROM SomeTable
GROUP BY CONVERT(datetime, CONVERT(varchar, DateColumn, 102))
0
 
LVL 35

Accepted Solution

by:
David Todd earned 500 total points
Comment Utility
Hi,

In excel use the trunc() function

in a3 put
=NOW()

in b3 put
=TRUNC(A3, 0 )

Format the results as appropriate ...

Cheers
  David
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

771 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

11 Experts available now in Live!

Get 1:1 Help Now