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

x
?
Solved

how to get date from a timestamp field

Posted on 2010-11-14
1
Medium Priority
?
429 Views
Last Modified: 2012-05-10
I have a datetimsatmp field dt1 in SQL server
I need to get the date portion of it

2010-11-14 16:52:26.957

result 2010-11-14
0
Comment
Question by:countrymeister
1 Comment
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 1000 total points
ID: 34132450
for 2008, just

convert(date, dt1)

for prior

datediff(d, 0, dt1)
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 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