SQL Select All and change the format of one column
casting, select, sql
Solution
It should let you do that, as long as you name the column something different:
Select *, CONVERT(varchar(100),courseStartDate,111) as myConvertedDateColumn
from EthicsManagement
Problem
I was wondering. If I have a table with 20(or more) column names in and I want to select All of them, but one column of those 20 columns is a date column and you would like to change the format of that column, how would you do that? This obviously didn't work (created duplicate columns) ``` Select *, CONVERT(varchar(100),courseStartDate,111) from EthicsManagement ``` This is to avoid writing a select statement selecting ALL 20 columns individually and converting one of them with the statement ``` Select xxxx,xxx,xxx,xxx,xx,xx,xxx,xxx,xx,xx,xxx,xxx,xx, CONVERT(varchar(100),courseStartDate,111) from xxx ```