Link to home
Start Free TrialLog in
Avatar of shinodmp
shinodmpFlag for India

asked on

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

how can i Remove time from GetDate() without using substring
ASKER CERTIFIED SOLUTION
Avatar of Binuth
Binuth
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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