Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Type a string date
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Miscellaneous
Thread ID:
01496168
Message ID:
01496204
Views:
38
thank boris,

if we have not "./-" in the string because somedate was Created with dtoc( somedate , 1 ) ?



>But how:
>even this:
>01.01.2011 00:00:00
>is a VALID datetime.
>You can't check the value of any of the time portion, because zero is valid.
>Maybe you could check the length of the string and if it is bigger that 8 (10 if you have separators) then it is T else D
>
>Something like:
>
>IF LEN(CHRTRAN(A,"./-","")) < 9
>   ? "D"
>ELSE
>   ? "T"
>ENDIF
>
>
>
>>hi Naomi,
>>
>>
>>i serach something as :
>>
>>
>>a = somedate
>>
>>
>>if MINUTE( CTOT( TTOC(A))) > 0
>>return 'T'
>>else
>>return 'D'
>>endif
>>
>>
>>
>>
>>
>>>You need to use ttoc for the datetime value.
>>>Do you now want to find out the type of the string variable depending on
>>>'20110114'
>>>
>>>vs.
>>>
>>>'20110114092723'
>>>?
>>>
>>>>sorry for my poor english....
>>>>
>>>>first sample
>>>>
>>>>a = dtoc( datetime() , 1 ) 
>>>>
>>>>?  something() return 'T'  && i want 'T'
>>>>
>>>>
>>>>second sample
>>>>
>>>>a = dtoc( date() , 1 ) 
>>>>
>>>>?  something() return 'D'  && i want 'D'
>>>>
>>>>
>>>>
>>>>>Bernhart,
>>>>>
>>>>>maybe I have a bad day, but I don't understand what you want.
>>>>>
>>>>>>hi all,
>>>>>>
>>>>>>a = dtoc( datetime() , 1 ) OR a = dtoc( date() , 1 )
>>>>>>
>>>>>>I want a formule that give "T" or "D" when i type A
>>>>>>
>>>>>>how can i have this ?
>>>>>>
>>>>>>
>>>>>>thank in advance
>>>>>>
>>>>>>bernhart
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform