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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Statement No working.

Status
Not open for further replies.

Razor1

IS-IT--Management
Nov 21, 2002
81
US
I don'r write a lot of sql statements so I would appreciate help with this.

I need to update a colunm with the current value plus and .csv to the end of the contents in the column.

Example:
ARBatchFileName = R01234 (Currently)
After update it should be: ARBatchName = R01234.csv

Here is the code I used:
UPDATE Invoice
SET ARBatchFileName = ARBatchFileName + '.csv'
WHERE (((ARBatchFileName) Not Like '%.csv'));

The column ARBatchFileName now contains 'ARBatchFileName.csv'
Instaead of twhat was in the column originally.

Thanks in advance for any help.

Razor1
 
The code you used seems to be correct.

Instead of UPDATE I suggest to first try select statement, e.g.
Code:
select ARBatchFileName, ARBatchFileName + '.csv'
from Invoice where ARBatchFileName NOT LIKE '%.csv'

If this works correctly, change select to your UPDATE.

PluralSight Learning Library
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top