ASPDEV
asked on
FoxPro 6.0 Update Year in the datetime field
Hello,
I can get Year from FroPro 6.0
Select Year(Datetime) from Customer
I get year from all the rows.I need to update just Year in the Field How can I do that.
I can get Year from FroPro 6.0
Select Year(Datetime) from Customer
I get year from all the rows.I need to update just Year in the Field How can I do that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It worked, but I'm missing the TimeStamp, I get 00:00.
Needed valid ones like 01:50
Needed valid ones like 01:50
ASKER
I got it:
UPDATE Customer Set Datetime = CTOT(allt(str(Month(Dateti me))) + "/" + allt(str(Day(Datetime))) + "/" + allt(str(Year(Datetime)+3) ))) + allt(str(hour(datetime))) + ":" + allt(str(minute(datetime)) ))
UPDATE Customer Set Datetime = CTOT(allt(str(Month(Dateti
ASKER
Thanks
Above formula could fail when you try to update February 29th.
Shorter and region independent syntax is:
UPDATE Customer Set Datetime = DTOT(GOMONTH(Datetime, 36)) + (Datetime-DTOT(TTOD(Dateti me)))
Shorter and region independent syntax is:
UPDATE Customer Set Datetime = DTOT(GOMONTH(Datetime, 36)) + (Datetime-DTOT(TTOD(Dateti
ASKER
Cool, it worked as well.
Thanks
Thanks
ASKER
e.g
02/09/2007 01:50
I need to change year from 2007 to 2010
like 02/09/2010 01:50