>I am sorry, I should have made it more clear about the date format. I think I was just frustrated with the fact that the info was in a character field and they wanted it filtered by date. FYI: 01/01/01 was the format. There was no century set for this.
>
>Thanks for the input. I will try this. Do you think there is a way to solve this situation without having to create an addition field?
>
>Thanks again!
>
>N. Lea
Lea,
01/01/01 sampling is mysterious :) It could be any combination of MM,DD,YY.
Anyway I suppose it's MM/DD/YY.
You could have it w/o addition of another field (in fact it's not an addition - after getting date format you would kill old and rename it).
Now w/o any additional field :
set century to 19 rollover 50
lcDate = '01/12/02'
set date to dmy
? trans(ctod(lcDate),'@YL')
set date to mdy
? trans(ctod(lcDate),'@YL')
set date to ymd
? trans(ctod(lcDate),'@YL')
PS:Set date is scoped to current data session. Don't forget to set it explicitly in private datasessions.
Make sure you have an index with the experssion you use so you could optimize your searches. ie: if you use MDY :
set date to MDY
index on ctod(myCharDateField) tag myTag
locate for ctod(myCharDateField) = {^2001/01/31}
Cetin