Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Genius is that energy which collects, combines, amplifies and animates
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!


How Do I Split the Date and Time from a DateTime field using SQL

During a recent SQL Server Reporting Services report writing project the client needed to separate the Date and Time from a DateTime field


To split a date time field into its component date and time values, I have used the Convert function, but the Cast function can also be used.

For the date field, the SQL was formatted for the UK date format:

SELECT [Tablename.DateTimeField],
CONVERT(Varchar(10),CONVERT(Date,[Tablename.DateTimeField]),103) as [Shipped Date],
CONVERT(Varchar(8),CONVERT(Time,[Tablename.DateTimeField])) as [Shipped Time]
FROM Tablename

If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us


Name *

Email Address *

Comment *

To prove you are human what is:

69 + 26 =