Subtract Dates stored as text fields

R

Radhika

I have two fields in the same table:
1. ClinDate
2. AD (Default Value: =Now())

AD inculded both the date and time. Is there any way in which i can change
it just to date?

Also, both are text fields. I want to substrat AD-Date. However, i get an
error msg saying 'Data type mismatch' when i try to do so. What am I doing
wrong?
How can I subtract the two?

Thank you
Radhika
 
R

Radhika

Thank you!

KARL DEWEY said:
DateValue(CVDate([AD])) - CVDate([ClinDate])
--
KARL DEWEY
Build a little - Test a little


Radhika said:
I have two fields in the same table:
1. ClinDate
2. AD (Default Value: =Now())

AD inculded both the date and time. Is there any way in which i can change
it just to date?

Also, both are text fields. I want to substrat AD-Date. However, i get an
error msg saying 'Data type mismatch' when i try to do so. What am I doing
wrong?
How can I subtract the two?

Thank you
Radhika
 
J

John W. Vinson

I have two fields in the same table:
1. ClinDate
2. AD (Default Value: =Now())

AD inculded both the date and time. Is there any way in which i can change
it just to date?

Use =Date() as the default instead of =Now().

To update existing values, update the field to Format(DateValue([AD])),
"mm/dd/yyyy") using the format that you want.
Also, both are text fields. I want to substrat AD-Date. However, i get an
error msg saying 'Data type mismatch' when i try to do so. What am I doing
wrong?

WHY are they text fields, if you want them to store date information? You're
making your life much harder than it needs to be! Is there any good reason NOT
to store date data in a date field, in your circumstances?
 
Top