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
 
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?
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Last Visit information 7
Complex query 4
Count and sum per month in a query 2
Before Update 6
convert text to date 1
Default Value in Table 2
Auto fill 3
Problems displaying dates 5

Top