?
Solved

SQL server DateTime

Posted on 2007-08-09
5
Medium Priority
?
169 Views
Last Modified: 2013-11-07
I have a field (Week_Start_Date) of DataType DateTime (SQL SERVER 2000)
I pass a string from my GUI and in the stored procedure i convert it to MM/DD/YY Format

SELECT @WEEKSTARTDT = CONVERT(DATETIME,@WEEKSTARTDATE,101)  
after the insertion  I get  the value of date along with time "2/8/2007 12:00:00 AM"
I dont want time to be there in the column.

What is that to be done. can it be shown.
0
Comment
Question by:dotnet0824
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:dbbishop
ID: 19666451
You'll need to convert it back into a string in your SELECT query:
CONVERT(CHAR(10), Week_Start_Date, 101) AS Week_Start_Date
0
 

Author Comment

by:dotnet0824
ID: 19666459
does it mean that you cant insert just the date excluding the time.
0
 
LVL 15

Accepted Solution

by:
dbbishop earned 1000 total points
ID: 19666461
SQL Server does not have a straight DATE or a TIME format. You always have to store the two together and parse out the portion you want (using CONVERT) if you don't want to see both.
0
 
LVL 15

Expert Comment

by:dbbishop
ID: 19666468
That is what it means.
0
 

Author Comment

by:dotnet0824
ID: 19666515
Thanks a lot . i tried it out . works great though.
0

Featured Post

Industry Leaders: 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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

850 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