Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESS AND SQL

Status
Not open for further replies.

ijitnoin

Programmer
Jan 26, 2006
18
US
While executing a Access Application/Program, records are inserted into a table. The following INSERT statement was executed:
INSERT INTO table_Import (RecordID, Ctrlno, [Check], CheckDate, Total, ImportDate, Side) VALUES ('3269BEA39C804C15822D826C55F5DAC2', '200605220997', '5006', #5/22/2006#, 8.32, #6/6/2006 10:49:12 AM#, 'FILE')

An error occurs after DB.SQLINSERT statement. What is the problem? In Access, #06/05/06# is valid. Data in the VALUES statement are as defined in the table. I tried to run this INSERT as a View also but errors were received. What is the problem? Thanks in advance for your help!
 
Is this table in Oracle database? If so, then can you post the error message?

Also, The column name "[check]" is not in Oracle compatible format.

Anand
 
ijitnoin,

the major problem is the Access #symbol, which it uses to denote dates. Get rid of these right away. Then use a to_date function to convert the characters to dates.

Code:
VALUES ('3269BEA39C804C15822D826C55F5DAC2', '200605220997', '5006', TO_DATE('5/22/2006','MM/DD/YYYY') 8.32, TO_DATE('6/6/2006 10:49:12','MM/DD/YYYY HH24:MI:SS'), 'FILE')

should do the trick for you. Note taht I have assumed that you are using American date formats, and not my native English format.

Let me know how it works out.

Regards

Tharg

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top