A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update Part# field where is blank



 
 
Thread Tools Display Modes
  #1  
Old August 18th, 2004, 10:20 PM
JUAN
external usenet poster
 
Posts: n/a
Default Update Part# field where is blank

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
  #2  
Old August 19th, 2004, 12:42 AM
Damon Heron
external usenet poster
 
Posts: n/a
Default

Use an update query

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

HTH
Damon


"JUAN" wrote in message
...
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



  #3  
Old August 19th, 2004, 01:16 AM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default

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



JUAN wrote:

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

  #4  
Old August 19th, 2004, 02:23 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Wed, 18 Aug 2004 14:20:31 -0700, "JUAN" wrote:

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


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
  #5  
Old August 19th, 2004, 08:54 PM
juan
external usenet poster
 
Posts: n/a
Default

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-----
On Wed, 18 Aug 2004 14:20:31 -0700, "JUAN"

wrote:

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


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppressing a blank field in a report Kay Setting Up & Running Reports 4 July 14th, 2004 05:08 PM
Unable to Update Field Stupid Question Using Forms 1 July 9th, 2004 03:38 AM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM
How to update a field with the value from another table? Chris Database Design 2 May 12th, 2004 09:28 AM


All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.