myLittleTools Community Forum

Welcome Guest Search | Active Topics | Members | Log In | Register

retrieving date in certain format in SELECT query Options · View
gater
Posted: Friday, May 13, 2011 9:17:44 PM
Rank: Newbie
Groups: Member

Joined: 4/28/2011
Posts: 2
Points: 12
my table inserts a date as "5/17/2011 12:00:00 AM", which is the way the SELECT query returns it. How is the best way to retrieve it as "5/17/2011"? Do I format the SELECT syntax somehow?
elian
Posted: Monday, May 16, 2011 9:59:34 AM

Rank: Administration
Groups: Administration

Joined: 9/11/2006
Posts: 605
Points: 649
Location: Enghien Les Bains, France
DATETIME datatype stores both date and time.

If you're using SQL Server 2008+, then you can use the datatype DATE (that only stores date).
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Theme created by myLittleTools
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.