Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Database Design

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-27-2006, 01:43 AM
wasim_sono wasim_sono is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: May 2005
Location: Pakistan
Posts: 68
wasim_sono
Default inserting values in column based another column

Dear All

I have a table having a column of Date of Birth. another column named Date of Retirement. Now I want to create an update query that fills the column date of retirement by adding 60 in year of Date of Birth.

I have 1200 record in my table so I want to fill it by query.

Please help me.

Thanks.


Wasim
Reply With Quote
  #2  
Old 06-27-2006, 03:23 AM
Expert
 
Join Date: Dec 2005
Location: Wilmington, DE - USA
Posts: 275
matthewspatrick
Send a message via MSN to matthewspatrick
Default

Wasim,

Generally speaking, it is a bad idea to store derived values in a database table. If the retirement date is always at the employee's 60th birthday, and if you already store the birth date, then the best practice is to not store the retirement date, and instead calculate it on demand.

Also, it is a bad idea to put spaces in field names (or table, query, form, or report names, for that matter).

If you still want to do this:

UPDATE YourTable
SET [Date Of Retirement] = DateAdd("y", 60, [Date Of Birth])
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
individual records in same column on form Sharron Forms 0 10-04-2008 07:05 PM
centre justify column text marky Access 0 09-01-2008 10:02 AM
split a column into two seperate columns nybanshee Access 2 08-14-2008 02:52 PM
2 different fields into 1 column by query? rainxking Queries 1 06-04-2006 07:37 AM
Added items in a column. Wrangler Forms 3 03-25-2006 04:56 PM


All times are GMT -8. The time now is 01:54 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.