Calculating number of days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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'
 
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.
 
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

Ed Warren said:
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.

crybicki said:
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'
 
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.


crybicki said:
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

Ed Warren said:
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.

crybicki said:
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'
 
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'


Ed Warren said:
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.


crybicki said:
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

Ed Warren said:
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
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'
 
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.

crybicki said:
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'


Ed Warren said:
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.


crybicki said:
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

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
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'
 
Back
Top