Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering problem...
Message
From
01/05/2001 03:31:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/05/2001 03:15:54
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00501870
Message ID:
00501876
Views:
25
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform