Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cmonth
Message
From
08/01/2003 10:33:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Cmonth
Miscellaneous
Thread ID:
00738680
Message ID:
00739310
Views:
9
>Yes, there is a problem. If you run select cmonth(somedate)... , you cannot know what will be the size of the field, and so if the first cmonth encountered by vfp was 4 chars wide, that will be the size of all your column ( if the first month is June for instance ). The best way is to use a fixed length in the result of your sql column, something like :
>select left(cmonth(SomeDate),10) as MyMonthName, etc...
left() doesn't give a fixed length. For instance, left("abc", 10) will return only 3 bytes.

padr(cMonth(...), 10) is appropriate for returning a fixed length.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform