473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

adding today's date to a table

I am creating a database for a video shop and in the loans table want
there to be a field for date taken, with a default value of today.
Trying to write =today() as in the help gives an error, while using
=date() adds todays date, but this changes as the date changes.
Please help.

Janet Chapman
Nov 13 '05 #1
5 8327
I have a table that does this. Fieldtype is Date/Time and in the Default
Value I have Date() (no "=" sign). Required is set to "no". This returns
today's date as the default however you can change it if you want. Maybe
I'm misunderstanding you but wouldn't you want the date to change as the
current date changes?


"Janet Chapman" <ja*********@hotmail.com> wrote in message
news:85**************************@posting.google.c om...
I am creating a database for a video shop and in the loans table want
there to be a field for date taken, with a default value of today.
Trying to write =today() as in the help gives an error, while using
=date() adds todays date, but this changes as the date changes.
Please help.

Janet Chapman

Nov 13 '05 #2

"Janet Chapman" <ja*********@hotmail.com> wrote in message
news:85**************************@posting.google.c om...
I am creating a database for a video shop and in the loans table want
there to be a field for date taken, with a default value of today.
Trying to write =today() as in the help gives an error, while using
=date() adds todays date, but this changes as the date changes.
Please help.


I don't understand what you mean by "changes as the date changes" -- the
default value for a field is only used when a new record is created, and
that is what I understood that you wanted. Because it is a "default" value,
the user can overtype it in a form and the user's value will be what is
stored.

I also am not certain why you thought that Today() was an Access built-in
function. Perhaps you are thinking of some other software?

Larry Linson
Microsoft Access MVP
Nov 13 '05 #3

Thank you for your response. I wanted the date for each record to
default to the day that record was created, and not update itself to
todays date, which is what happens with Date().

Janet
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4
gj
Janet Chapman wrote:
I am creating a database for a video shop and in the loans table want
there to be a field for date taken, with a default value of today.
Trying to write =today() as in the help gives an error, while using
=date() adds todays date, but this changes as the date changes.
Please help.

Janet Chapman

Add the field to the table.
In the table definition set the default value to DATE(). If you wnat it
to store the data and time set the default value to NOW() ensuring you
have selected GENERAL DATE as the first optiojn in the properties.

Alternately, you can set the default value in a form but my preference
for these fields is the table.

Have fun.

GJ
Nov 13 '05 #5
i too am trying to do this but i get a compile error if i save when trying to switch out of design view. any ideas?
May 1 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Phil Powell | last post by:
The date field I believe is of type datetime, but I'm sorry I have absolutely no idea how to put today's date into a datetime column using ASP and SQL Server. Folks, I'm a LINUX guy!!! This is a...
2
by: Charles Rouse | last post by:
How can I automatically add a weekly charge of $2.00 for each client in drug treatment? I have a "financial" table linked with the client table with 4 fields: clientID, date, charge, paid. Every...
2
by: markryde | last post by:
Hello, I am trying to add the current date to a file name in python script like thus: import os import sys import rpm import time import datetime
5
by: M Skabialka | last post by:
I am creating my first Visual Studio project, an inventory database. I have created a form and used written directions to add data from a table to the form using table adapters, data sets, etc. ...
2
by: Maximus | last post by:
I need some help. I have an .asp page that interfaces with an Access table (wjs_SuperInput). The .asp page looks to the table and pulls a recordset based on a job number, 12345, and a weekending...
5
by: dan | last post by:
I could find no documentation that the Date object has useful wrapping properties. For example, write(new Date(2007, 11 + 1, 1)) results in January 1st 2008. And write(new Date(2007, 0, 31 + 1))...
3
by: xxtokenxx | last post by:
I am writing a birthday list for a site for my school. While developing it. Currently the code for the output of birthdays is: <html><head> <title>Birthday List</title><script...
5
by: nkechifesie | last post by:
Hi, I have written a VBA program that runs on Excel and puts data on the excel sheet. This runs everyday. I want to be adding the dates to the files, this date is gotten from the excel sheet that...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.