Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CTOT() not working for variable, but works for literal
Message
 
 
To
21/03/2008 11:09:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01304337
Message ID:
01304348
Views:
12
You're welcome.

>works like a charm. Thanks, Sergey.
>
>>Try
>>
>>dVal_date = CAST(aCondition[nCond_row,3] AS datetime)
>>
>>>
>>>I have a program where I save a date or datetime, depending on what field they pick. Later, the user can go back in and edit that field variable they saved. But I can not seem to get CTOT() or CTOD() to work correctly with the variable after I get it from the same table, where it is saved as a character string.
>>>
>>> dVal_date = CTOT(SUBSTR(aCondition[nCond_row,3], AT("(", aCondition[nCond_row,3]) + 2, nDate_width + 12))
>>>
>>>so I tried,
>>>
>>>  lcstring = SUBSTR(aCondition[nCond_row,3], AT("(", aCondition[nCond_row,3]) + 2, nDate_width + 12)
>>>  lcstring = strtran(lcstring, ["])
>>>  dVal_date = CTOT(lcstring)
>>>
>>>
>>>dVal_date keeps saying { // :: }, not the correct time.
>>>The value in aCondition[nCond_row,3] is "01/01/2001 12:00 AM"
>>>
>>>Can someone point me to my problem?
>>>
>>>TIA
>>>Beth
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform