Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: Teradata - Converting Date Format Q

    Hi All.
    I need a way to execute a select statement where values are being passed dynamically from an ASP page. Everything is fine if I execute a query like this...

    SELECT * FROM TableName
    WHERE Col1 = '12-1-2003'
    AND Col2 = '234';

    The problem is the format of the date (which is dynamically generated from a 3rd party calendar app) is pumped into the field in mm/dd/yyyy format.
    If left like this, Teradata gives me an error:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
    [NCR][Teradata RDBMS] A character string failed conversion to a numeric value.

    Which is because of the improperly formatted date. Is there a way I can convert this to the proper format within the SQL statement. The dynamically built statement looks like this:

    SQL = SQL & "TableName = '" & Request.Form("date") & "' " _
    & "order by Column1 "

    Thank you.

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    The simple solution would be to write a function or expression that will reformat the date for you "on the fly" into the ISO format used by Terradata.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts