[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how can i remove the time from getdate using with out substring?

Posted on 2008-11-11
4
Medium Priority
?
426 Views
Last Modified: 2012-05-05
how can i Remove time from GetDate() without using substring
0
Comment
Question by:shinodmp
3 Comments
 
LVL 14

Accepted Solution

by:
Binuth earned 200 total points
ID: 22937268
select convert(varchar,getdate(),101)
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 22937292
0
 
LVL 2

Expert Comment

by:rajeshprasath
ID: 22937750
SQL Server does not have separate data types for date and time. If you want to split the date and time separately then you have to convert datetime into varchar datatype.

Date:
select convert(varchar,getdate(),101)

Time:
select convert(varchar,getdate(),108)

For more conversion format visit the following link,
http://msdn.microsoft.com/en-us/library/ms187928.aspx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Integration Management Part 2
Screencast - Getting to Know the Pipeline

834 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