Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select date value 1

Status
Not open for further replies.

PsychoCoder

Programmer
May 31, 2006
140
US
OK,

I have a web application Im working on in .Net, I do a query to retrieve certain information from a table, one of them being a datetime value. The column holds only the date (no time) but when I select it out it gives a time of 12:00AM by default, how can I get only the date?
 
The only way to remove the time is to convert the DateTime to a string (not in the table, but in the select that returns the data). Take a look at this.

Code:
Select Convert(VarChar(10), GetDate(), 101)
Select Convert(VarChar(11), GetDate(), 100)
Select Convert(VarChar(11), GetDate(), 102)
Select Convert(VarChar(11), GetDate(), 103)

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
gmmastros,

Thank you so much, I forgot that I had to convert it before pulling it out.
 
This could be treated as a presentation issue... Display the date in the web application without the time, no matter what time might be attahed to the date, including 12am...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top