How convert my date?
How convert my date?
(OP)
I am using MS-SQL SERVER 2000, VB6, CR8
a field is datetime and "01.05.2001 00:00:00"
and this field is as group
I am to view this field "01 May 2001 Tuesday"
How ?
Thanks.
a field is datetime and "01.05.2001 00:00:00"
and this field is as group
I am to view this field "01 May 2001 Tuesday"
How ?
Thanks.
RE: How convert my date?
Date(
Val({field} [ 7 to 10 ] ),
Val({field} [ 4 to 5 ] ),
Val({field} [ 1 to 2 ] ) )
You can then format this date field however you like. You might need to do some error checking to make sure that dates aren't blank or don't have invalid values.
Ken Hamady
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
RE: How convert my date?
If Crystal Reports recognizes the field as a string type field, then you could convert the string to a date, and then pick the format option you want for the date. Normally this would just be DateValue({yourdatetimestringfield}), but since the "." character is not recognized as a valid date separator, you would need to replace the "." with "/".
DateValue( Replace({yourdatetimestringfield}, ".", "/") )
This method may be preferable, especially in situations where the datetime string varies in length, or you expect to encounter blank (empty string) values.
Malcolm