Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird date problems 3

Status
Not open for further replies.

dstepans

Programmer
Jun 3, 2003
39
0
0
US
Hello,

I have this in a formular:

stringVar result := "";
result := cstr(Year ({Claim.ServiceTo}));
result;

For the date: 1/1/03 it returns 2,003.00 Why is it formatting it like that? How could I get 2003 or 03?

I also get the same format for the Day and Month (1.0 instead of 1 or 01).

Anyway to fix it?

TIA,
Denis
 
It probably has to do with how you have numbers formatted by default. Try Right clicking the field, choose Format Field, then either highlight the correct format that you want ot choose custom and set it up.

~Brian
 
Another simpler Totext format would be

Totext({Table.date},"yy"}) for 2 digit year or "yyyy" for 4 digit

Similarly Totext({Table.date},"dd"}) for Day and
Totext({Table.date},"MM"}) for Month

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top