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:
<snip>
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
[NCR][Teradata RDBMS] A character string failed conversion to a numeric value.
</snip>
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.