Answer #3...
'Cause
and there's nothing we can do about it...
At least with xBase and VFP there's ALWAYS a work-around (so far)...
Chet
Chet Gardiner wrote:
Answer #2...
I would say that when selecting numeric fields, VFP defaults to the
worst case. That is, it takes the lengths of the numeric field into
account (so that it WON'T overflow) when setting the length of the
resulting field and then considers any conversions to string.
This is a GOOD thing if you think about it. It's much better to have
a numeric field that's too long than to have a numeric overflow
whereas truncating a string doesn't kill things the way numeric
overflow does.
Some things are inscrutable...
Chet Gardiner wrote:
The default length for STR(<numeric>) is 10 Characters - right
aligned padded with leading blanks.
Add one for the "/" and you'll default to 21 chars.
If you want a standard representation:
SELECT STRTRAN(str(nMonth, 2) + "/" + str(nYear, 4), " ", "0") AS
monyear
Lew Schwartz wrote:
I have a table with 2 numeric cols, one for month, the other for year.
If I go to the top of the table where the month is 1 and create a
cursor
of with a character column formatted mm/yyyy's with the statement
select alltrim(str(nMonth))+"/"+alltrim(str(nYear)) ....
I get a column that's 21 characters wide -- the width of the 2
underlying numeric columns, plus 1 for the /
I thought I would get a col 6 character wide .... Ie
len(alltrim(str(nMonth))+"/"+alltrim(str(nYear)))
so what is it that I don't understand about trim() functions and
column
types and widths?
...seems I should know this; don't all shout at once
-Lew
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.