Update Query Question...

M

Michelle

I have a form that keeps track of updates made to another table. However
what I would like is to update the other table with the changes.
Example
I have 1 table called IP Data and 1 called IPCData
I have 10 fields in each table and sometimes only one of the 10 fields gets
updated how whould I be able to tell the query to only update that data in
IPData if there is data in IPCData.
IPData
IP MAC User Internet
SWPrt
1.1.1.1 00-00-00-00-00 jsmith no
5-2
1.1.1.2 00-00-00-00-01 bsmith yes
1-20


IPCData
IP MAC User Internet
SWPrt
1.1.1.1 dsmith yes
1.1.1.2 00-00-00-00-07
1-7

after I run the updat the IPDat should look like this....

IP MAC User Internet
SWPrt
1.1.1.1 00-00-00-00-00 dsmith yes
5-2
1.1.1.2 00-00-00-00-07 bsmith yes
1-7

right now I am getting this as results

IP MAC User Internet
SWPrt
1.1.1.1 dsmith yes
1.1.1.2 00-00-00-00-07
1-7
 
A

Andy Hull

Hi Michelle

The update query you need to use will take the form...

update IPData inner join IPCData on IPData.IP = IPCData.IP
Set IPData.Mac = ... ,
Set IPData.User = ... ,
etc

The Set's will all be the same format so I'll just use Mac as an example.

If the blanks in IPCData are all Nulls (and not empty strings ie "") then
you can use the following...

Set IPData.Mac = Nz(IPCData.Mac, IPData.Mac)

If the blanks could be Nulls or empty strings then use...

Set IPData.Mac = iif(Nz(IPCData.Mac) = "", IPData.Mac, IPCData.Mac)

Regards

Andy Hull
 
M

Michelle

I changed the code this is what I have now and it gives me an error Syntax
Error on Update

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag = iff(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =iff(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
iff(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
iff(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac = iff(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept = iff(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
iff(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] = iff(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID = iff(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan = iff(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP = iff(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));
 
J

John Spencer

Change IFF to IIF.


UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
IIF(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =
IIF(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
IIF(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
IIF(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac =
IIF(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept =
IIF(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
IIF(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] =
IIF(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
IIF(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan =
IIF(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP =
IIF(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
I changed the code this is what I have now and it gives me an error Syntax
Error on Update

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag = iff(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =iff(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
iff(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
iff(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac = iff(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept = iff(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
iff(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] = iff(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
iff(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan = iff(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP = iff(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));


Andy Hull said:
Hi Michelle

The update query you need to use will take the form...

update IPData inner join IPCData on IPData.IP = IPCData.IP
Set IPData.Mac = ... ,
Set IPData.User = ... ,
etc

The Set's will all be the same format so I'll just use Mac as an example.

If the blanks in IPCData are all Nulls (and not empty strings ie "") then
you can use the following...

Set IPData.Mac = Nz(IPCData.Mac, IPData.Mac)

If the blanks could be Nulls or empty strings then use...

Set IPData.Mac = iif(Nz(IPCData.Mac) = "", IPData.Mac, IPCData.Mac)

Regards

Andy Hull
 
M

Michelle

I changed it and still get the same error.

John Spencer said:
Change IFF to IIF.


UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
IIF(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =
IIF(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
IIF(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
IIF(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac =
IIF(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept =
IIF(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
IIF(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] =
IIF(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
IIF(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan =
IIF(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP =
IIF(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
I changed the code this is what I have now and it gives me an error Syntax
Error on Update

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag = iff(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =iff(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
iff(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
iff(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac = iff(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept = iff(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
iff(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] = iff(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
iff(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan = iff(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP = iff(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));


Andy Hull said:
Hi Michelle

The update query you need to use will take the form...

update IPData inner join IPCData on IPData.IP = IPCData.IP
Set IPData.Mac = ... ,
Set IPData.User = ... ,
etc

The Set's will all be the same format so I'll just use Mac as an example.

If the blanks in IPCData are all Nulls (and not empty strings ie "") then
you can use the following...

Set IPData.Mac = Nz(IPCData.Mac, IPData.Mac)

If the blanks could be Nulls or empty strings then use...

Set IPData.Mac = iif(Nz(IPCData.Mac) = "", IPData.Mac, IPCData.Mac)

Regards

Andy Hull


:

I have a form that keeps track of updates made to another table.
However
what I would like is to update the other table with the changes.
Example
I have 1 table called IP Data and 1 called IPCData
I have 10 fields in each table and sometimes only one of the 10 fields
gets
updated how whould I be able to tell the query to only update that data
in
IPData if there is data in IPCData.
IPData
IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 jsmith no
5-2
1.1.1.2 00-00-00-00-01 bsmith yes
1-20


IPCData
IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7

after I run the updat the IPDat should look like this....

IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 dsmith yes
5-2
1.1.1.2 00-00-00-00-07 bsmith yes
1-7

right now I am getting this as results

IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7
 
J

John Spencer

Next step is to break this down into steps.

Try

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset)
WHERE IPCData.Date=Date()

See if that works. If so, add the clause to update the next field. If it
breaks then start looking at why it might break.

You are doing this all in the SQL window and not the query grid, aren't you?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
I changed it and still get the same error.

John Spencer said:
Change IFF to IIF.


UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
IIF(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =
IIF(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
IIF(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
IIF(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac =
IIF(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept =
IIF(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
IIF(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] =
IIF(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
IIF(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan =
IIF(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP =
IIF(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
I changed the code this is what I have now and it gives me an error
Syntax
Error on Update

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
iff(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =iff(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
iff(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
iff(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac = iff(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept = iff(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
iff(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] = iff(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
iff(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan = iff(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP = iff(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));


:

Hi Michelle

The update query you need to use will take the form...

update IPData inner join IPCData on IPData.IP = IPCData.IP
Set IPData.Mac = ... ,
Set IPData.User = ... ,
etc

The Set's will all be the same format so I'll just use Mac as an
example.

If the blanks in IPCData are all Nulls (and not empty strings ie "")
then
you can use the following...

Set IPData.Mac = Nz(IPCData.Mac, IPData.Mac)

If the blanks could be Nulls or empty strings then use...

Set IPData.Mac = iif(Nz(IPCData.Mac) = "", IPData.Mac, IPCData.Mac)

Regards

Andy Hull


:

I have a form that keeps track of updates made to another table.
However
what I would like is to update the other table with the changes.
Example
I have 1 table called IP Data and 1 called IPCData
I have 10 fields in each table and sometimes only one of the 10
fields
gets
updated how whould I be able to tell the query to only update that
data
in
IPData if there is data in IPCData.
IPData
IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 jsmith no
5-2
1.1.1.2 00-00-00-00-01 bsmith yes
1-20


IPCData
IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7

after I run the updat the IPDat should look like this....

IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 dsmith yes
5-2
1.1.1.2 00-00-00-00-07 bsmith yes
1-7

right now I am getting this as results

IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7
 
A

Andy Hull

Hi again Michelle

Have you got this sorted?
The thread is ticked but I don't know when or who by.

Did you know your first set refers to IPData.tblClosets instead of WCloset?

Youe wrote:
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),

Should be?:
SET IPData.WClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),

BUT... that won't stop a syntax error!

Are you doing this in VBA code?

Common practice would be...

SQLString = "whatever your SQL is..."
DoCmd.RunSQL SQLString

But with such a long piece of SQL you would want to split it over several
lines so you can read it easily in the VBA editor, like...

SQLString = "UPDATE IPData " & _
"INNER JOIN IPCData ON IPData.IP = IPCData.IP " & _
"SET IPData.WClosets = " & _
"IIF(Nz(IPCData.WCloset="",IPData.WCloset,IPCData.WCloset), " & _
"SET IPData.SWTag = " & _
"IIF(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag), " & _
etc

Note the & to concatenate the strings on each line followed by a space &
then _ to say the line continues on the next. Also, make sure each string
ends with a space. If you left the space of the end of the first line so it
was

SQLString = "UPDATE IPData" & _

the SQL would start...

UPDATE IPDataINNER JOIN IPCData ON IPData.IP = IPCData.IP

Note IPData running into INNER - this would give a syntax error. A space on
the end of the first string like

SQLString = "UPDATE IPData " & _

makes the SQL start...

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP

so IPData doesn't run into INNER.

Maybe you already got this sorted so this lengthy post wasn't needed but
just in case...!

Regards

Andy Hull


John Spencer said:
Next step is to break this down into steps.

Try

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset)
WHERE IPCData.Date=Date()

See if that works. If so, add the clause to update the next field. If it
breaks then start looking at why it might break.

You are doing this all in the SQL window and not the query grid, aren't you?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Michelle said:
I changed it and still get the same error.

John Spencer said:
Change IFF to IIF.


UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
IIF(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
IIF(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =
IIF(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
IIF(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
IIF(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac =
IIF(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept =
IIF(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
IIF(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] =
IIF(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
IIF(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan =
IIF(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP =
IIF(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

I changed the code this is what I have now and it gives me an error
Syntax
Error on Update

UPDATE IPData INNER JOIN IPCData ON IPData.IP = IPCData.IP
SET IPData.tblClosets =
iff(Nz(IPCData.WCloset)="",IPData.WCloset,IPCData.WCloset),
SET IPData.SWTag =
iff(Nz(IPCData.SWTag)="",IPData.SWTag,IPCData.SWTag),
SET IPData.SWPrt =iff(Nz(IPCData.SWPrt)="",IPData.SWPrt,IPCData.SWPrt),
SET IPData.PtchPnl =
iff(Nz(IPCData.PtchPnl)="",IPData.PtchPnl,IPCData.PtchPnl),
SET IPData.PtchPrt =
iff(Nz(IPCData.PtchPrt)="",IPData.WCloset,IPCData.PtchPrt),
SET IPData.Mac = iff(Nz(IPCData.MAC)="",IPData.MAC,IPCData.MAC),
SET IPData.Dept = iff(Nz(IPCData.Dept)="",IPData.Dept,IPCData.Dept),
SET IPData.[Position] =
iff(Nz(IPCData.Positon)="",IPData.Position,IPCData.Positon),
SET IPData.[User] = iff(Nz(IPCData.User)="",IPData.User,IPCData.User),
SET IPData.UserID =
iff(Nz(IPCData.UserID)="",IPData.UserID,IPCData.UserID),
SET IPData.VLan = iff(Nz(IPCData.VLan)="",IPData.VLan,IPCData.VLan),
SET IPData.IP = iff(Nz(IPCData.IP)="",IPData.IP,IPCData.IP)
WHERE (((IPCData.Date)=Date()));


:

Hi Michelle

The update query you need to use will take the form...

update IPData inner join IPCData on IPData.IP = IPCData.IP
Set IPData.Mac = ... ,
Set IPData.User = ... ,
etc

The Set's will all be the same format so I'll just use Mac as an
example.

If the blanks in IPCData are all Nulls (and not empty strings ie "")
then
you can use the following...

Set IPData.Mac = Nz(IPCData.Mac, IPData.Mac)

If the blanks could be Nulls or empty strings then use...

Set IPData.Mac = iif(Nz(IPCData.Mac) = "", IPData.Mac, IPCData.Mac)

Regards

Andy Hull


:

I have a form that keeps track of updates made to another table.
However
what I would like is to update the other table with the changes.
Example
I have 1 table called IP Data and 1 called IPCData
I have 10 fields in each table and sometimes only one of the 10
fields
gets
updated how whould I be able to tell the query to only update that
data
in
IPData if there is data in IPCData.
IPData
IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 jsmith no
5-2
1.1.1.2 00-00-00-00-01 bsmith yes
1-20


IPCData
IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7

after I run the updat the IPDat should look like this....

IP MAC User
Internet
SWPrt
1.1.1.1 00-00-00-00-00 dsmith yes
5-2
1.1.1.2 00-00-00-00-07 bsmith yes
1-7

right now I am getting this as results

IP MAC User
Internet
SWPrt
1.1.1.1 dsmith
yes
1.1.1.2 00-00-00-00-07
1-7
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top