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!

Help debug SELECT / REPLACE Quey

Status
Not open for further replies.

foxup

Programmer
Dec 14, 2010
328
CA
Hi,

I have 2 queries for which I need a little help. The 2 queries have nothing to do with each other. They are 2 separate queries. I know I can't do a "replace" in a "select" but I'm a little confused on how to do this. Here are the 2 queries:

Query 1
USE MST1101

REPLACE AMOUNT_REM WITH '3021', SUP_NUM WITH '008' FOR AMOUNT_REM='3004' AND CUST_PHONE IN (SELECT PHONE FROM CLITELS WHERE TYPE=7)


Query 2
USE ARTRANS

REPLACE TYPE WITH '3021' FOR TYPE='3004' AND PHONE IN (SELECT PHONE FROM CLITELS WHERE TYPE=7)


Please help me.


Thanks,
FOXUP!
 
You must use the sql update command.


Update YourTableName ;
Set amount_rem = '3021', ;
sup_num = '008' ;
where amount_rem = '3004' and cust_phone in (select phone from cliTels where type = 7)




Ali Koumaiha
TeknoSoft Inc.
Michigan
 
ok, the 1st seems to work. help with query 2 please?

 
What additional help is needed for your 2nd query?

Ali gave you working code for the 1st query and you can just modify it as needed, using the same general method, to address your 2nd query.

Good Luck,
JRB-Bldr
 
I got it. All works fine. Thanks everybody. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top