Invalid column name in query string - using Format function

Advertisement

In my post just before this one the problem was solved for writing a query string using a date range. The rest of the query string includes the same date field (Call_Date) but formatted as 'MMM-YY'. I get an invalid column name error when I add this field to the query string. Here is the rest of the query string:
strSql = "SELECT Format(CALL_DATE,'mmm-yy'), " _
& "HOME_REGION FROM CCC2.CASE_EPRP " _
& "WHERE (HOME_REGION = 'NCR') AND " _
"(CALL_DATE >= to_date( '1/1/2002', 'MM/DD/YYYY' )" _
& "AND CALL_DATE <= to_date( '2/28/2003', 'MM/DD/YYYY' ))"
In the Access Query tool I can include this field
Format(CALL_DATE,'mmm-yy')
and the query runs fine (I just need to make it dynamic using ADO). But in my ADO query string above, I get the invalid column name error. Is there a way I can include
Format(CALL_DATE,'mmm-yy')
in my ADO query string? I appologize for not being more familiar with Oracle Sql. Any help greatly appreciated.
Thanks again,
Rich

Advertisement

Thank you very much for your reply. I think I'm getting closer to the solution. Just I got an error message
"date format not recognized"
when I add "to_char( call_date, 'mmm-yy' )" to the query string. I tried using all uppercase, but that did not make a difference. Do I need to use to_date inside the to_char maybe?
to_char(to_date(call_date, 'mmm/yy'), 'mmm-yy')
Thanks again for your help.
Rich

October 11, 2015

Invalid column name in query string - using Format function

In my post just before this one the problem was solved for writing a query string using a date range. The rest of the query string includes the same date field (Call_Date) but formatted as 'MMM-YY'. I get an invalid column name error when I add this

Column exist but ResultSet.getString(String) return invalid column name

With oracle 7 db the ResultSet.getString(String) works fine but after the upgrade to oracle 8 db it return invalid column name. ResultSet.getString(int) method works fine. Is this a bug in the driver? Thanks -RedaYes I'm 100 % sure that the columns e

Invalid column name in IMGSimilar

Hi all, I have a question for the function IMGSimilar. I have a table musterbildsig, in which the generated signatures of 100 pictures are stored in the column msbild_sig. Each Signature in this table is to compare with all signatures in the column b

Sysdate gives Invalid column name

Using Oracle/Tomcat, I'm invoking the following query through JSP: SELECT id from my_table where create_date >= (sysdate-10) where create_date is a field in my_table. When I run it through JSP, it gives me Invalid column name error, but when I copy t

SQLException: invalid column name

I created a view on a Oracle 8.0.5 database which joins three tables. One column of the view is built by subtracting the values of two table-columns by each other. On SQLPlus everything works fine, but when I run a SELECT-Statement over JDBC I got a

Invalid column name (with ojdbc)

hi, I created a resultSet by executing query with more then one table in it. (left join) and now i want to getObject. so I execute resultSet.getObject("tablename.columnName") and I get this error "invalid column name". when i'm doing t

Java.sql.SQLException:  Invalid column name: user_id

Hi, I am using SQL Server 2000 database and using a Java DAO class executing an SQL query using preparedStatement.The issue is that intermittently i get the following exception: "SQLException:Invalid column name". I checked the filed name in the

Sybase JDBC driver & Invalid column name error

I submitted a note a year ago concerning JDBC-ODBC bridge and SQL Server db. Same Invalid column name error. The resolution was a bug in the XSU code. This time the error is with a jconnect5 JDBC driver from Sybase to a Sybase ASA db. ASA is Adaptive

Case Decode - invalid column name error

select Workweek, max( decode( Type, T34, prct, null ) ) Bad,                     max( decode( Type, T35, prct, null ) ) Repair,                     max( decode( Type, T36, prct, null ) ) Good FROM (select Workweek, Type, round(ratio_to_report(sum(Tes

Exception: Invalid column name 'UserAccountDirectoryPath'

we're upgrading MOSS 2007 to sharepoint 2010 using attach database, we ran a prerequisite check on source server everything passed successfully we took a backup and restore it in new server and ran  Mount-SPContentDatabase , and failed due to below e

Invalid Column Name message in the subquery

Hi All, I am receiving the invalid column name message in the subquery. Please help me if there is any work around or change in the query: Sample query: update table1 set table1.column1 = (Select column1 from (Select column1 from table2 where table1.

Help on Merge Statement ,I got 'ORA-00904: invalid column name' Error

Pls help In Oracle 9i i implement the following qry MERGE INTO jobs A USING (select order_no,jOB_SEQ_NO from jobs_dlt) B ON (A.ORDER_NO = B.ORDER_NO and A.JOB_SEQ_NO =B.JOB_SEQ_NO ) WHEN MATCHED THEN UPDATE SET           A.ORDER_NO= B.ORDER_NO ,     

Help! Invalid Column Name

As a beginner keen in learning C# database programming, I followed an example on YouTube. The followings are the steps: 1.  Created a form with two text boxes, namely txtID and txtName 2.     Created a program. The part for creating the sql and sql c

Invalid column name 'tp_Level'

I am receiving a lot of errors in the event log that states -Invalid column name 'tp_Level'  I would like to resolve whatever the discrepancy is, but I don't know where to begin. I appreciate any help. Thanks.Config Wizard doesn't re-publish the sche

Invalid column name in WLS 6.1 sp4

We have been using WLS 6.1 sp2 with toplink and never had any problems. Recently we migrated to sp4 and get a invalid column name exception while updating records. For select queries there is no error. The SQL generated by toplink is - UPDATE PR_SUPP

Invalid Column Name Problem

Hi.. I have a table component and that is bound to a Database Table. I have button name "UPDATE" which commits changes to DB. When I press "UPDATE" button an error occurs... Number of conflicts while synchronizing: 1 SyncResolver.UPDAT

Dimension processing failure - Invalid Column Name

Hello I have copied our Account Dimension from Prod to Dev because we are testing 7.5MS. I have Maintained Properties and modified dimension successfully. But when I process i get the foll error :   - OLE DB error: OLE DB or ODBC error: Invalid colum

Invalid Column Name on db link from 11.2.0.2 Oracle to 11.2.0.2 Gateway

Hello, I am running the Oracle database 11.2.0.2 and using a database link accessing a sql server 2008 R1. The link is working fine, but a table has columns that are greater than 30 chars and Oracle db gateway cannot access this. Does anyone know of

Display column total on the header using Formatted Search

Hello, I'm trying to create a FS on a Sales Order header (UDF) that will summarize a column from the row level. For example, I'd like to display the sum of the quantity in the header. I've tried the following syntax: Select sum($[$-38.11.NUMBER]) but

"Invalid column type" error while calling pl/sql function in AM

Code written in AM is ... String MISSING_TIME_SHEET_CALL = "begin ? = missing_time_sheet(?,?,?,?); end;"; CallableStatement timeSheetStmt = txn.createCallableStatement(MISSING_TIME_SHEET_CALL, 1); timeSheetStmt.registerOutParameter(1,Types.BOOLE