access courses - update queries acting only
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access Training and help » access courses - Update Queries acting on only part of a table

access courses - Update Queries acting on only part of a table

The UK's most regular instructor-led training courses.
Training information: access courses · Microsoft access courses · Microsoft Access Training uk
See also · microsoft access training · access vba courses · access database course

resolvedResolved · Low Priority · Version Standard

Update Queries acting on only part of a table

Ricardo has attended:
Access VBA course
Access Advanced course

by - delegate Ricardo [8 posts] (2007 Jun 20 Wed, 15:24) replyReply

Hi

I have a large-ish table (call it [tbl_accounting] ), with say 9 fields, the primary key being clientname.

I have recently receieved information in an excel spreadsheet such that I can update one of those fields (the "fees" field).

The excel information is in 2 columns - one is the clientname, and the other column contains fees.

I'm sorry if this is a silly question, but how would you run an update query to update only those records who have fee information in the excel spreadsheet, and leave the other fields & records alone?

I imported the excel spreadsheet as a new table (say [tbl_feeimport] making clientname the primary key) and tried to run an update query from that, but it didn't work. I'm sure this can be done via SQL or maybe via the Access update queries, but I'm afraid I'm not sure fully how- any help would be gratefully accepted!

Thanks

Ricardo

Access VBA 2 day course
Version Date Location Places
available
Book Next place rate:
Card Invoice
2003 2008 Dec 4 Thu + 5 Fri Southwark 7 book now £345 £399
2003 2009 Jan 8 Thu + 9 Fri Southwark 6 book now £450 £485
2003 2009 Feb 5 Thu + 6 Fri Southwark 8 book now £275 £399
2003 2009 Mar 5 Thu + 6 Fri Southwark 7 book now £345 £399
2003 2009 Apr 8 Wed + 9 Thu Southwark 8 book now £275 £399
2003 2009 May 7 Thu + 8 Fri Southwark 8 book now £275 £399
Full Schedule: See all 12 Access VBA course dates.
Bookings currently available until 5th November 2009.

RE: Update Queries acting on only part of a table

by - trainer David gold contributer[428 posts] (2007 Jun 28 Thu, 14:17) replyReply

Hi Ricardo,

The sql you would need is:

UPDATE table_name
SET column_1 = new_value
column_2 = new_value
column_3 = new_value
WHERE primary_key = primary_key_value

Hope this helps

David

RE: Update Queries acting on only part of a table

by - delegate Ricardo [8 posts] (2007 Jul 16 Mon, 10:55) replyReply

That's great - thankyou David


Related articles

· MS Access and Database Normalisation
· Material covered on a Microsoft Access Course
· Why go on a Microsoft Access Training Course?
· MS Access: Access your Personal Information with Ease
· Reasons to Consider Microsoft Access Training

Access tip:

Calculating The Difference Between Dates

If you wish to calculate the time between two date fields, this can be done in a number of ways:

1. As a calculated field in a query
2. As a calculated control in a form or report
3. As a calculation in a VBA procedure.

The basic syntax to get the number of days between two dates is:

=[One Date Field] - [Another Date Field]

You can also use one of the following functions:

=Month([One Date Field] - [Another Date Field])
which calculates the number of months between the two fields

=Year([One Date Field] - [Another Date Field])
which calculates the number of years between the two fields.

Another function is the DateDiff() function.

It uses an argument to determine how the time interval is measured. For example:

=DateDiff("q",[One Date Field] - [Another Date Field])
returns the number of quarters between the two fields.

Other intervals that can be used in this expression are as follows:
"yyyy" - Years
"m" - Months
"d" - Days
"w" - Weekdays
"ww" - Weeks
"h" - Hours
"n" - Minutes
"s" - Seconds

View all Access hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information

Training Articles

AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz