Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Insert Default Date/Time Value into a Database Table

Posted on 2015-02-05
3
Medium Priority
?
294 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

916 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