[TIP] Extracting some part of date, time and datetime values.

Claudius Sailer Claudius at sailer-online.de
Sun May 15 09:01:22 CDT 2005


Am 15. Mai 2005 um 00:06 Uhr schrieb Ruslan Zasukhin:

> On 5/14/05 10:32 PM, "Claudius Sailer" <Claudius at sailer-online.de>  
> wrote:
>
>
>>> Don't use such code:
>>>
>>>
>>>
>>>>> db.sqlExecute("update students set logged_in = substr(curdate(),
>>>>> 1, 4) where
>>>>> (ID = '4')");
>>>>>
>>>>>
>>>
>>> Because of:
>>>
>>> 1. We have a number of DateTime based SQL functions like YEAR(),
>>> MONTH()...
>>> 2. The string representation for such values may differ depending on
>>> current DateTime format. So it's just unsafe.
>>>
>>
>> but no possibility to get only date from CURDATE()!!
>> This is very strong needed :-))
>>
>
> Why you think so ???
>
> Ivan says exactly that we HAVE such possibility.
>
> As I understand this should work:
>
>     Year( now() )


Sorry this is a missunderstanding. What I want is not YEAR or MONTH.  
I want the DATE

I have
15.05.2005 20:11:10.564

I want
15.05.2005

IMHO I can only solve this by using RB XXX.nthfield(" ",1)
not inside V4RB2-SQL or did I missed something?

bye


Claudius

-- 
G4/733 QS / MacOS X 10.4de / RB 5.5.3de/ Valentina 1.10.0 & 2.0.3
Homepage    http://www.ClaSai.de
iChat        ryhoruk
RealBasic ListBoxes: [ I feel the need...the need for speed!!! ]



More information about the Valentina mailing list