Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / November 2005

Tip: Looking for answers? Try searching our database.

Calculating number of days

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
crybicki - 29 Nov 2005 14:15 GMT
I have fields Date obtained and date (today) and I'm having difficulty geting
the field days [date] - [date Obtained] to work
I put [date] - [date Obtained] in Default Value
Saving error : The database engine does not recognize either the field
'date' in a validation expression, or the default value in the table 'Table1'
Ed Warren - 29 Nov 2005 14:34 GMT
Look under help for the function datediff("d", [date1],[date2])  this is the
function you are looking for

if the 'default value' is in a form you will use the formula above.  If you
are trying to store this in a database, you most likely don't want to save
the calculated value.

Ed Warren.

>I have fields Date obtained and date (today) and I'm having difficulty
>geting
[quoted text clipped - 3 lines]
> 'date' in a validation expression, or the default value in the table
> 'Table1'
crybicki - 29 Nov 2005 15:38 GMT
Thanks Ed
What I need is to show up for how many days we have car in our stock.
So I have Date1 where I put date in short form
We have Date which should show current date in short form, what shoud I put
as default value , CDate?
Chris

> Look under help for the function datediff("d", [date1],[date2])  this is the
> function you are looking for
[quoted text clipped - 12 lines]
> > 'date' in a validation expression, or the default value in the table
> > 'Table1'
Ed Warren - 29 Nov 2005 19:47 GMT
If you want to know how many days from date1 to the current date
you want to set the field binding to:
=datediff("d", date1,date()), this will always give you the current number
of days since date1 was entered.

Ed Warren.

> Thanks Ed
> What I need is to show up for how many days we have car in our stock.
[quoted text clipped - 23 lines]
>> > 'date' in a validation expression, or the default value in the table
>> > 'Table1'
crybicki - 30 Nov 2005 03:55 GMT
Hi Ed
I'm still geting this error
The database engine does not recognize either the field 'Date1' in a
validation expression, or the default value in the table 'Table1'

> If you want to know how many days from date1 to the current date
> you want to set the field binding to:
[quoted text clipped - 30 lines]
> >> > 'date' in a validation expression, or the default value in the table
> >> > 'Table1'
Ed Warren - 30 Nov 2005 09:34 GMT
Then you need to resolve which is giving the problem.

You need to make sure you have appropriate default values (or none) in
table1 and you have a field date1 stored as a date/time in table1
At least one appropriate default for a date/time is now().

Ed Warren.

> Hi Ed
> I'm still geting this error
[quoted text clipped - 40 lines]
>> >> > 'date' in a validation expression, or the default value in the table
>> >> > 'Table1'
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.