Solved

Insert Default Date/Time Value into a Database Table

Posted on 2015-02-05
3
257 Views
Last Modified: 2015-02-05
Hello Experts

I wondered if there is an easy way of inserting one Date/Time value to all of my records in a database table.  Here is a summary of the situation.  I have been assigned a Membership Directory that is in excel format.  I have already imported the data into an access database table and made some changes.  We realized that we wanted to keep track of the dates that new members joined.  Therefore, we created a date time field that we will update going forward.  The question is, can we input one date (say 01/01/2015) into all of the current records, which is approximately 5,000 strong?

Thanks...
0
Comment
Question by:idejjedi2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40592362
yes, use an update query

Update TableName
Set [DateFieldName]=#1/1/2015#

now to automatically record date everytime a new member is added,
in the design view of the table
set the default value of the field to Date()
0
 

Author Closing Comment

by:idejjedi2
ID: 40592436
Rey - That was awesome - thank you.  As a follow up - only if easy.  If you wanted to do the same thing to a "Yes/No" data type??
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40592443
Update TableName
 Set [YesNoFieldName]=-1

-1 for true
0 for false
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question