Solved

Insert Default Date/Time Value into a Database Table

Posted on 2015-02-05
3
239 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
  • 2
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero 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 119

Expert Comment

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

-1 for true
0 for false
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now