Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL : Can I use Select... Order By SUBSTR(xxxxx) ?
Message
From
10/08/1999 01:13:32
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251237
Message ID:
00251870
Views:
7
Ed,

I guess for that, I need to re-engineer those which deals with Month using the full date field.
I'm very thankful with your info.

Gan

>
>I've gotten in the habit of always using a date field for the representation, and then forcing the date for the month to the first of the month when I want to ignore the day. This now lets me handle sorts trivially; no SUBSTR() is needed, and if I need to concatenate a key, I can use the DTOS() of the date field.
>
>You'll need to write a bit of code to handle the data representation in forms to allow entry into a text field and convert it to and from a date field. It's not all that tought to do, and you just do it once in a textbox class that handles that particular data entry task, and then use the textbox class as needed. You can create the MM/YY output in reports and for displays pretty trivailly using the MONTH() and YEAR() functions.
>
>>Gan
>>
>>>
>>>lets take a simple example where you want things sorted in ascending order, and you have an entry in December of 1999, which you've stored as 12/99, and another in January of 2000, which you've stored as 01/00. You use your sort expression given in the sample code. Which one will appear first?
Previous
Reply
Map
View

Click here to load this message in the networking platform