• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

SQL server DateTime

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
dotnet0824
Asked:
dotnet0824
  • 3
  • 2
1 Solution
 
dbbishopCommented:
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
 
dotnet0824Author Commented:
does it mean that you cant insert just the date excluding the time.
0
 
dbbishopCommented:
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
 
dbbishopCommented:
That is what it means.
0
 
dotnet0824Author Commented:
Thanks a lot . i tried it out . works great though.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now