Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get current date in table in default

Status
Not open for further replies.

Bengriffiths

IS-IT--Management
Oct 19, 2004
4
GB
Hi, i am building a database on a Video renting store. In the renting table it has a date and i want it to defaulty come up with todays date. How can i make this happen?

Thank you.
 
in the design view of the table, with that field select up top, go ot the properties at the bottom. The field should be dat/time format. In the default value type: now()

In the format, use the drop down to get the format you want it to show. Save and go.

misscrf

Management is doing things right, leadership is doing the right things
 
Now() will include both the date and time. If you only want the date, then use Date() as the default value.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Your right about now() but that is why I suggested the format option. It gives the desired result. I tested it.

misscrf

Management is doing things right, leadership is doing the right things
 
The problem with using Now() is when Bengriffiths creates a query and enters a criteria like:
#12/8/2004#
it will return 0 records. Also,
Between #12/1/2004# And #12/5/2004#
will miss all the records from 12/5/2004.


Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Ok it worked great thanks. Is there away for the return date to be 1 day after the rented date? using this default value.

Thanks for the help.
 
You can't set a default in a table to be a value dependent on another field in the table. You could set defaults in a form control or set the default in the table to be
Date()+1

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Don't you want to wait to enter the return date information until the video is returned? Do you really just need to print the EXPECTED return date on the reciept?

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top