Time Calculations

F

fgwiii

Good morning,

I have a listing containing the following data:
PT CONTDTD VISDTD
100100001 20030430 20020417
100100002 20030530 20020531
100100003 20030910 20020822
I need to know records that are greater then 11 months as well as those
records that are not.

I tried running DateDiff, but my query was unsuccessful.

Thank you,

Fred
 
A

Allen Browne

Apparently these are Text or Number fields, and you need to convert them
into dates.

Try typing an expression like this into the Field row in your query:
CDate(Format([ContDTD], "0000\/00\/00"))

If that gives the correct date, you can do the same thing for the VisDTD
field, and then use DateDiff() to get the difference in months.
 
F

fgwiii

Thank you!

Allen Browne said:
Apparently these are Text or Number fields, and you need to convert them
into dates.

Try typing an expression like this into the Field row in your query:
CDate(Format([ContDTD], "0000\/00\/00"))

If that gives the correct date, you can do the same thing for the VisDTD
field, and then use DateDiff() to get the difference in months.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

fgwiii said:
Good morning,

I have a listing containing the following data:
PT CONTDTD VISDTD
100100001 20030430 20020417
100100002 20030530 20020531
100100003 20030910 20020822
I need to know records that are greater then 11 months as well as those
records that are not.

I tried running DateDiff, but my query was unsuccessful.

Thank you,

Fred
 
Top