January 22, 2019 at 4:17 pm
I have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00
I cant remember the syntax........ugh
I know there are several ways to do it......
go....
January 22, 2019 at 4:30 pm
thomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
January 22, 2019 at 4:43 pm
Jeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
January 22, 2019 at 9:22 pm
thomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 22, 2019 at 11:07 pm
Jeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
January 23, 2019 at 7:27 am
Lynn Pettis - Tuesday, January 22, 2019 11:07 PMJeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
Aginity
January 23, 2019 at 7:34 am
thomas.miller1 - Wednesday, January 23, 2019 7:27 AMLynn Pettis - Tuesday, January 22, 2019 11:07 PMJeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
Aginity
I've no clue as to what that is but it sounds to me like that app is the thing causing you the pain because SSMS will display the CAST(SomeColumn as DATE) without the time element.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2019 at 7:48 am
Jeff Moden - Wednesday, January 23, 2019 7:34 AMthomas.miller1 - Wednesday, January 23, 2019 7:27 AMLynn Pettis - Tuesday, January 22, 2019 11:07 PMJeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
Aginity
I've no clue as to what that is but it sounds to me like that app is the thing causing you the pain because SSMS will display the CAST(SomeColumn as DATE) without the time element.
I was afraid of that, they don't use management studio here, this app is how they are connecting to the server. I guess I will google it, thanks.
January 23, 2019 at 7:49 am
thomas.miller1 - Wednesday, January 23, 2019 7:48 AMJeff Moden - Wednesday, January 23, 2019 7:34 AMthomas.miller1 - Wednesday, January 23, 2019 7:27 AMLynn Pettis - Tuesday, January 22, 2019 11:07 PMJeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
Aginity
I've no clue as to what that is but it sounds to me like that app is the thing causing you the pain because SSMS will display the CAST(SomeColumn as DATE) without the time element.
I was afraid of that, they don't use management studio here, this app is how they are connecting to the server. I guess I will google it, thanks.
Netezza....
January 23, 2019 at 7:52 am
thomas.miller1 - Wednesday, January 23, 2019 7:49 AMthomas.miller1 - Wednesday, January 23, 2019 7:48 AMJeff Moden - Wednesday, January 23, 2019 7:34 AMthomas.miller1 - Wednesday, January 23, 2019 7:27 AMLynn Pettis - Tuesday, January 22, 2019 11:07 PMJeff Moden - Tuesday, January 22, 2019 9:22 PMthomas.miller1 - Tuesday, January 22, 2019 4:43 PMJeffrey Williams 3188 - Tuesday, January 22, 2019 4:30 PMthomas.miller1 - Tuesday, January 22, 2019 4:17 PMI have a column that I need to display as date only. Right now I get 2019-01-01 00:00:00I cant remember the syntax........ugh
I know there are several ways to do it......
go....
CAST(datecolumn AS date)
If this is going to something like SSRS - then don't bother with cast or convert and set the format in the text field of the report/cell.
CAST(A.SOLD_DATE AS DATE)
I understand the CAST but this did not remove the 00:00:00
Where are you running the code from?
Sounds to me that it is getting converted back to a datetime value after being converted to a date value.
Aginity
I've no clue as to what that is but it sounds to me like that app is the thing causing you the pain because SSMS will display the CAST(SomeColumn as DATE) without the time element.
I was afraid of that, they don't use management studio here, this app is how they are connecting to the server. I guess I will google it, thanks.
Netezza....
Found it, lol TO_CHAR(SomeColumn,'YYY-MM-DD')....ugh
January 23, 2019 at 8:21 am
thomas.miller1 - Wednesday, January 23, 2019 7:52 AMFound it, lol TO_CHAR(SomeColumn,'YYY-MM-DD')....ugh
That's an Oracle function.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply