Indra
I am not familiar with FoxPro, but just looking at your code, it appears
that the string you are ultimately trying to convert to a date looks like
this: 3-13-99 [for march 3, 1999]. FoxPro may not like the "-" character
for conversion to a date datatype. Try a "/" character. That is more
likely an acceptable date character.
Another reason may be the way that FoxPro handles dates. If a date is
treated as a number [ie the number of seconds since Jan. 1, 1919 or
something like that ] then you may have to do some other fancy manipulations
to create the date.
Mike Buraczewski
[log in to unmask]
-----Original Message-----
From: Indra Sofiar <[log in to unmask]>
To: [log in to unmask] <[log in to unmask]>
Date: Saturday, March 13, 1999 1:33 AM
Subject: [PCSOFT] Help
store day(date()) to myday
store month(date()) to mymonth
newyear = year(date()) - 16
newdate = alltrim(str(mymonth)) + "-" + alltrim(str(myday)) + ;
"-" + alltrim(str(newyear))
? "Current date is " + newdate + "."
! date newdate
Unfortunately, it wouldn't work and always ended up in "INVALID DATE".
I have tried to change the data type ("newdate") into Character, Numeric,
Date but it still wouldn't work. Why?
Thanks in advance for your help.
Regards,
Indra Sofyar
Do you want to signoff PCSOFT or just change to
Digest mode - visit our web site:
http://nospin.com/pc/pcsoft.html
|