Print Page | Close Window

Insert with fields and text

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22469
Printed Date: 02 May 2024 at 11:41am


Topic: Insert with fields and text
Posted By: mabrown
Subject: Insert with fields and text
Date Posted: 03 Oct 2017 at 11:05am
We need to insert 2 text fields and 2 fields from another table.  When I mix the text and fields I always get an error so what is the best way to do this?  We can clear the table before we insert data if needed but prefer not to.

We need to import as below and we need it to repeat 5 times on inv.i_id (Col1) for data 2 through 6:
text 1, Col1, text 2, Col2
text 1, Col1, text 3, Col2
text 1, Col1, text 4, Col3
text 1, Col1, text 5, Col3
text 1, Col1, text 6, Col3

Insert into TBL1 ("type","key", T_N, T_V)
 SELECT '22', inv.i_id, 'Met', inv.l_d  
    FROM INVENTOR
        LEFT JOIN inv  ON inv.i_id = "key"

We are getting an error on the join. I am guessing from the key being used as the col name but it is the only col we can join on.
thank you.




Replies:
Posted By: kevlray
Date Posted: 03 Oct 2017 at 1:08pm
Is this a crystal question or a SQL question?  If is an SQL question, then please provide the data source type (MS-SQL, Oracle, Access, etc.). Also your join is incorrect on any data source I know of.  You need to join to a field on the main table.



Print Page | Close Window