Amanda Walshaw
asked on
converting date and time into two columns
I am in the process of writing a view, i need to convert this field
BTime = 1899-12-30 13:15:00.000
to 25/10/2013 (column 1)
1.15pm (column 2)
i have used the following without success
for Date
convert(varchar(13), BTime, 100)
for time
convert(varchar, BTime, 100)
1.15pm is correct on on the date but the dates is not correct
and how do you hide the date for time.
BTime = 1899-12-30 13:15:00.000
to 25/10/2013 (column 1)
1.15pm (column 2)
i have used the following without success
for Date
convert(varchar(13), BTime, 100)
for time
convert(varchar, BTime, 100)
1.15pm is correct on on the date but the dates is not correct
and how do you hide the date for time.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
still experimenting with the time and dates
Open in new window
to 25/10/2013 (column 1)1.15pm (column 2)
Open in new window
also see: https://www.experts-exchange.com/blogs/PortletPaul/B_7503-SQL-Server-Date-Styles-formats-using-CONVERT.html