If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Differences
Hi I'm a novice on this one. If I want to have a field calculating the
differences between two date fields I enter the expression in "field properties" under "default value". Am I correct so far? then I create the expression. The data entry fields are "Today" and "DueDate" and one shot at the expression to calculate the "Countdown" field was =[Today]-[DueDate], I also tried =DateDiff ("d",[Today],[DueDate]) and other versions all to no avail. The error message I get on saving is "The Database Engine does not recognise either the field "Today" in a valid expression or the default value in the table HSEQ control table" Help please, thanks -- Peter |
#2
|
|||
|
|||
Date Differences
Use Date() rather than Today in Access.
But the expression goes into the Control Source, not the Default Value: =Date() - [DueDate] You should not have a field in your table to store this. Since it changes every day, it is something that should be calculated when needed. More info in: Calculated Fields at: http://allenbrowne.com/casu-14.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Peter" wrote in message ... Hi I'm a novice on this one. If I want to have a field calculating the differences between two date fields I enter the expression in "field properties" under "default value". Am I correct so far? then I create the expression. The data entry fields are "Today" and "DueDate" and one shot at the expression to calculate the "Countdown" field was =[Today]-[DueDate], I also tried =DateDiff ("d",[Today],[DueDate]) and other versions all to no avail. The error message I get on saving is "The Database Engine does not recognise either the field "Today" in a valid expression or the default value in the table HSEQ control table" |
#3
|
|||
|
|||
Date Differences
Try this:
Number I want:datediff("d",[now()],[due date]) "Peter" wrote: Hi I'm a novice on this one. If I want to have a field calculating the differences between two date fields I enter the expression in "field properties" under "default value". Am I correct so far? then I create the expression. The data entry fields are "Today" and "DueDate" and one shot at the expression to calculate the "Countdown" field was =[Today]-[DueDate], I also tried =DateDiff ("d",[Today],[DueDate]) and other versions all to no avail. The error message I get on saving is "The Database Engine does not recognise either the field "Today" in a valid expression or the default value in the table HSEQ control table" Help please, thanks -- Peter |
#4
|
|||
|
|||
Date Differences
On Wed, 9 Jul 2008 06:51:00 -0700, Golfinray
wrote: Try this: Number I want:datediff("d",[now()],[due date]) Actually leave off the brackets around Now() - otherwise Access will assume you have a field named Now() and complain. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|