Update Part# field where is blank

  • Thread starter Thread starter JUAN
  • Start date Start date
J

JUAN

Hello All,
i have the following two fields Part# and Cust#
Have some records that have blank part number but contain
a Cust# example,
PART# Cust#
zxe35
SER98
XR25 ZR25-R

Is it possible to copy the Cust# into the Part# only for
those records that are blank? Since I'm running a query
based on the Part# field, I will not get those records
with blank part number so want to make sure I copy the
Cust into its respective part# field.
Please advise if its possible.
Thanks,
juan
 
Use an update query

UPDATE Products SET Products.PART# = Products.Cust#
WHERE (((Products.PART#) Is Null));

HTH
Damon
 
Use the NZ function

SELECT Nz([Part#],[Cust#]) as MyPartNo
FROM YourTable

That will do show Cust# in the calculated column when Part# is Null.

If you want to PERMANENTLY do this in the table, use an update query.

UPDATE YourTable
Set [Part#] = [Cust#]
WHERE [Part#] is Null
 
Is it possible to copy the Cust# into the Part# only for
those records that are blank?

Yes, though in my opinion that's a VERY strange thing to do! Customers
are not Parts (I hope...!) and it sounds peculiar to assign a Cust# to
a part.

But to do so, create an Update query such as

UPDATE yourtable
SET [Part#] = [Cust#]
WHERE [Part#] IS NULL
 
Hello All,
just would like to thank all of you for providing help. I
guess my brain was sleeping. Once again thanks alot.

Juan
-----Original Message-----
Is it possible to copy the Cust# into the Part# only for
those records that are blank?

Yes, though in my opinion that's a VERY strange thing to do! Customers
are not Parts (I hope...!) and it sounds peculiar to assign a Cust# to
a part.

But to do so, create an Update query such as

UPDATE yourtable
SET [Part#] = [Cust#]
WHERE [Part#] IS NULL



.
 
Back
Top