Tags for cast
Median function - Fails on view when trying to cast as decimal
I have a database table which has four columns and two of the columns are INT. The two INT columns' rows are sometimes empty. When I try to cast them as DECIMAL(18,3) and then use the Median function I am getting the Error: An unknown character string translation was requested.  
cast median function decimal
Convert text to a timestamp
Hi All, I am trying to replicate the below vertica conversion to timestamp to teradata, But I am getting error. Can someone please guide me? Vertica: to_timestamp('June 7, 2016, Hour 0','Month DD, YYYY, Hour HH')  --output: '2016-06-07 00:00:00'          
cast timestamp
Select Failed 2666 Invalid date supplied
SELECT 'D' || A.ZARF_ECARS_1 || A.legacy_branch_rented as Transmittal_Number, A.ADDRESS1 as Address, A.CITY as CITY1, A.STATE as STATE1, A.POSTAL as ZIP, A.ITEM as Debtor_Reference, cast(A.due_DT as date format 'MM/DD/YYYY')  as DueDt, A.BAL_AMT as Amount_Due,
dates error 2666 cast
cast date between 2 different data types
I want to add a selection criteria to my SQL.  The user will select a 'from' and 'to' date, e.g., 11/1/2015 and 12/31/2015.  The date column (jsdate) in the table is Decimal (8,0).  When I look at the dates in this column it looks like 20,150,612, 20,150,609, 20,150,611, etc.  I'm trying to add a selection critieria like "and cast(jsdate as date format 'm
#database #teradata #sql cast between dates
Dear all, 
with recursive COLUMN TRUNCATED cast varchar
cast varchar value YYYY-MMM-DD HH:MI:SS to date
I have a VARCHAR column (CALL_START_DATE_TIME) and it's values are as shown below.   2014-OCT-31 15:52:35 2014-JUN-25 13:53:30 2013-DEC-26 19:56:40 2014-AUG-08 22:43:51 2015-APR-22 03:57:04   I need to apply date wise filter on this column as below:  
cast Convert free text date date
SQL Warning 5815 Function is not ANSI
This warning was returned in BTEQ after executing the following query. Is there something missing with the syntax? Please note that the SESSION TRANSACTION was set to ANSI and SESSION SQLFLAG was set to ENTRY. Both were configured intentionally.
Rounding: Result of division being forced to .000
I've read a few posts on this forum on how to force rounding to decimal places, but nothing is working. This is my latest attempt to try and have the results of a formula display decimals:
rounding cast
Hi... I'm running this query: SEL CAST(CAST('99--,-25--1'AS VARCHAR(15)) AS INTEGER) I would hope that the query fails, but it works, the resulset is: 99251.   I'm working with TD14 and TD12. Regards!!  
VARCHAR to INTEGER format or data contains a bad character cast
Problem in exporting data from BTQ to CSV
Hello,   I am running a BTQ script which is generating a .CSV file. One of the column in the file is a number but datatype for the same in the parent table is defined as CHAR. I am using a cast function to convert it into bigint( number is 13 digits long), results are fine when I am running this query in SQL Assiatant.
BTQ csv format cast