Undefined function TO_DATE, TO_NUMBER

Tech-Archive recommends: Fix windows errors by optimizing your registry



Though I used oleDB, and your select statement:
Imports System.Data.oledb
Dim con As OleDbConnection
Dim cmd1 As OleDbCommand
Dim totalStr As String = "SELECT(TO_NUMBER(to_date('18-AUG-2002')-to_date('14-AUG-2002'))) as Age FROM Calls"

con = New OleDbConnection(conStr)
con.Open()
cmd1 = New OleDbCommand(totalStr, con)
totalReportGrid.DataSource = cmd1.ExecuteReader()
totalReportGrid.DataBind()
con.Close()

I got an error msg like this;
Undefined function 'TO_NUMBER' in expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Undefined function 'TO_NUMBER' in expression.

How can I make it work?
--------------------------------
From: Rex Cho

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>m37NHLk8oUy/2XXDy/28kw==</Id>
.



Relevant Pages

  • Re: SQL server does not exist or access denied
    ... Are you sure that you have an sql server that can be accessed by name "BBIPROD"? ... Dim con As ADODB.Connection ... Set recordSet = CreateObject ...
    (microsoft.public.excel.programming)
  • Re: Undefined function TO_DATE, TO_NUMBER
    ... > Dim con As OleDbConnection ... > Dim cmd1 As OleDbCommand ... As the error message refers to interpretation of the select string, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Accessing data within objects
    ... Dim con As Object ... Dim rsImportedData As Object ... strFieldName =rsImportedData.fields..Name ...
    (microsoft.public.access.modulesdaovba)
  • Re: Querying sheet of unknown name
    ... Sub test() ... Dim Con As Object ... > into the problem of many of the excels not having standard sheet names ...
    (microsoft.public.excel.programming)
  • Re: DAO access error w.Ms Access
    ... > Dim con As OleDb.OleDbConnection ... >> You know, Chris. ... It's be really nice if I could upgrade to ADO.NET but I ...
    (microsoft.public.dotnet.languages.vb)