Date() as default value

sara27

Registered User.
Local time
Today, 04:21
Joined
May 8, 2009
Messages
11
Could anyone explain why when I set the default value in a DATE/TIME field to Date() it doesn't show anything? Do I need to have any specific add-ins for this to work.
Thank you:)
 
Open the table in design view, mark the field for the data value, set the field's property "Default value" to =Date()
 
I did that but it is not showing anything in the dataset view! I would expect it to show todays date where I have not put a specific date.
Thanks
 
By me it does.
attachment.php
 

Attachments

  • DefaultDate.jpg
    DefaultDate.jpg
    53.9 KB · Views: 230
OK I see what is happening - didn't think to look at the end of my table doh. New records are showing todays date but previous records are not - how can I get them to show todays date without having to re-enter all of them one by one?
Thanks :)
 
Would an update query ensure that the date will change each day as this is what I need as I am calculating the length of service todate.
Thanks
:)
 
Would an update query ensure that the date will change each day as this is what I need as I am calculating the length of service todate.
Thanks
:)
Are you saying that each record should have a different date and that date should decrease by one day as you step back through the records.
 
OK I have found a solution - as I didn't actually need the date to show anywhere I just needed to show length of service at the point of leaving or todate I have included date() in the equation thus
=IIf([Date Of Leaving]<Date()," " & Int(DateDiff('m',[Forms]![Staff List]![Date of Employment],[Forms]![Staff List]![Date of Leaving])/12) & " yrs " & (DateDiff('m',[Forms]![Staff List]![Date of Employment],[Forms]![Staff List]![Date of Leaving]) Mod 12) & " mths"," " & Int(DateDiff('m',[Forms]![Staff List]![Date of Employment],Date())/12) & " yrs " & (DateDiff('m',[Forms]![Staff List]![Date of Employment],Date()) Mod 12) & " mths "), bit longwinded but it does the job. Thanks for all your help.
 
sorry to hijack the post, very simple similar question... I have a date field but i want the default value to be blank (no date). any ideas? Thx
 
Normally it is blank if you don't set a default value.
 

Users who are viewing this thread

Back
Top Bottom