Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ERROR MESSAGE: Asp database connect to Oracle - TRUNC function.

    Good morning,

    I'm trying to connect to an oracle database to retrieve records than display the results back in ASP. When I do this using the code:

    Code:
    	strSQL = "select distinct "
    	strSQL = strSQL & "c.cust_name_key1 as lastname, "
    	strSQL = strSQL & "c.cust_name_key3 as middleinitial, "
    	strSQL = strSQL & "c.cust_name_key2 as firstname, "
    	strSQL = strSQL & "c.cust_street as address, "
    	strSQL = strSQL & "c.cust_city as city, "
    	strSQL = strSQL & "c.cust_state_cntry as state, "
    	strSQL = strSQL & "c.cust_postal_code as zipcode, "
    	strSQL = strSQL & "c.txnl_licn_type as licensetype, "
    	strSQL = strSQL & "c.ltype_desc as licensedescription, "
    	strSQL = strSQL & "c.txnl_year as LicenseYear, "
    	strSQL = strSQL & "c.txnl_expire_date as expiredate, "
    	strSQL = strSQL & "c.cust_res_type as residence "
    	strSQL = strSQL & "from "
    	strSQL = strSQL & "flhf.customer_license_view c "
    	strSQL = strSQL & "where "
    	strSQL = strSQL & "c.agent_county = " & select_county & " "
    	strSQL = strSQL & "and trunc (c.txnl_expire_date) "
            strSQL = strSQL & "between (sysdate+1) and ( " & expire_Date & ") "
    with the variables select_county being the county givin by the user and expire_Date being the expire date provided by the user as well, I get the error message :
    Code:
    Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    
    [IBM][CLI Driver][DB2/NT] SQL0440N No function by the name "TRUNC" having compatible arguments was found in the function path. SQLSTATE=42884
    
    /reports/county_asp_from_html_real_one.asp, line 72
    Need help, totally LOST!! Unfamiliar with error message.

    -Thanks
    Last edited by bsharif; 12-05-2007 at 02:36 PM.

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    If you're using an Oracle database, why are you getting an error message from an IBM DB2 driver?


  •  

    Posting Permissions

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