Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TSQL Date Format Query Syntax

Posted on 2011-03-10
4
Medium Priority
?
408 Views
Last Modified: 2012-06-27


This I am sure its easy but I can find it online

I need to return a date with time as 0000 or no time

But I dont wat to use the convert because I dont what to make it a string

I like to keep it as a  date


This 2011-02-27 10:52:46.310

would return 2011-02-27 00:00:00.000
or 2011-02-27

what to keep as date not using convert


0
Comment
Question by:Leo Torres
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:bizbiz20032003
ID: 35096080
Function Date(xxxxx) ?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35096091
cast ( yourfield as date)
0
 
LVL 15

Accepted Solution

by:
derekkromm earned 2000 total points
ID: 35096131
dateadd(day, 0, datediff(day, 0, '2011-02-27 10:52:46.310'))
0
 
LVL 8

Author Closing Comment

by:Leo Torres
ID: 35096228
thank you that was exactly what I am looking for
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

715 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