In my vbscript, I update a table using this sql pass-thru:
strsql = "and stores in("GAP","OLD NAVY","BANANA REPUBLIC","NEW STORE") and acct = "SALARY"
strsql1 = "update table1 set SalesP1 = 0, SalesP2 = 0, SalesP3 = 0 where "
strsql1 = strsql1 & " YEAR = '2007' " & strsql
Comm.commandtype = 1
Comm.commandtext = strsql1
Comm.execute
Since NEW STORE does not have any record yet, NEW STORE/SALARY does not get updated with 0.
One option for me is to do a delete and insert:
strsql1 = "delete from table1 where YEAR = '2007' " & strsql
Comm.commandtype = 1
Comm.commandtext = strsql1
Comm.execute
How do I handle the insert?
Any help will be greatly appreciated.
strsql = "and stores in("GAP","OLD NAVY","BANANA REPUBLIC","NEW STORE") and acct = "SALARY"
strsql1 = "update table1 set SalesP1 = 0, SalesP2 = 0, SalesP3 = 0 where "
strsql1 = strsql1 & " YEAR = '2007' " & strsql
Comm.commandtype = 1
Comm.commandtext = strsql1
Comm.execute
Since NEW STORE does not have any record yet, NEW STORE/SALARY does not get updated with 0.
One option for me is to do a delete and insert:
strsql1 = "delete from table1 where YEAR = '2007' " & strsql
Comm.commandtype = 1
Comm.commandtext = strsql1
Comm.execute
How do I handle the insert?
Any help will be greatly appreciated.