newbie query from access to SQL

ironvid

Registered User.
Local time
Today, 19:27
Joined
Aug 14, 2003
Messages
18
Hi

I have a simple query that I use in access which works great!

UPDATE dbo_MT_Document SET dbo_MT_Document.Text_Field_8 = [Text_Field_1] & "-" & [Text_Field_2]
WHERE (((dbo_MT_Document.ID_Job)="0000000004E") AND ((dbo_MT_Document.Is_Batch)=0));

I can't get it to work in SQL Server, I have tried a few variations but with no luck.

thanks for any help!

Stephen
 
This is probably because your tablename in the SQLServer is not DBO_MT_DOCUMENT...
The DBO_ part is ussually an appendage for SQLServer.

Try taking out DBO_ "everywhere" and see if that helps... BE CAREFULL tho! Running update queries is a dangerous business if you dont EXACTLY know what you are doing!
 
Hi

Cheers namliam

The "dbo_ " was just because I pasted it from access

The problem was the "&" need to be changed to "+" and the Quote marks to '

Final query:

UPDATE MT_Document SET MT_Document.Text_Field_8 = [Text_Field_1] + '-' + [Text_Field_2]
WHERE (((MT_Document.ID_Job)="0000000004E") AND ((MT_Document.Is_Batch)=0));

you are right about running update queries if you don't know what you are doing! I always backup up first

Thanks Stephen
 

Users who are viewing this thread

Back
Top Bottom