How to convert number format to date format 
Author Message
 How to convert number format to date format

I am new to CR8.0. If I want to convert the number e.g 20010809 to date
format such as 09/08/2001, How ?
If I have a selection criteria for example from date to date, How to do ?
Coding will be appreciated. Thanks!


Sun, 01 Feb 2004 16:14:30 GMT  
 How to convert number format to date format

Quote:
> I am new to CR8.0. If I want to convert the number e.g 20010809 to date
> format such as 09/08/2001, How ?

Crystal Decisions offers a UFl for this (don't know whether it is 2000 proof
or not):

NumberToDate(x):
Where "x" is a NUMERIC value in the format YYMMDD, this function will
convert it into Crystal Date format: Date(YYYY,MM,DD).

NumberToDate(950715)     This would return Date(1995,07,15)
NumberToDate(971231)     This would return Date(1997,12,31)

Look for the UFLTDATE.EXE file on Crystal's Support site. I think this link
will bring you there:

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/UFLTD...
.asp

Gert



Mon, 02 Feb 2004 01:45:18 GMT  
 How to convert number format to date format
Hi Kelly,

I'm new to CR too and had the same problem.
Maybe this is not the perfect way to do it, but it works :
WDATE is numeric and contains 20010809
to print it out in a readable way :

ToText ({WDATE} mod 100,"00",0) + "/" + totext(truncate({WDATE} / 100) mod
100,"00",0) + "/" +
totext(truncate({WDATE} / 10000),"0000",0,"")

To compare a date (eg 08/09/2001) with the number in the database, I should
first create a number variable, then create a formula like this : (Year *
10000) + (Month * 100) + Day, giving 20010908.
This field can be compared with your database field.
I have no idea what possibilities CR has to do it in a 'professional' way.
I'm trying to create my first report...

esteban


Quote:
> I am new to CR8.0. If I want to convert the number e.g 20010809 to date
> format such as 09/08/2001, How ?
> If I have a selection criteria for example from date to date, How to do ?
> Coding will be appreciated. Thanks!



Mon, 02 Feb 2004 17:15:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. searching a routine to convert date number in normal format date

2. from Microsoft format Number to IEE format Number

3. convert Full date from minutes to normal date format

4. Formatting Unformated Numbers in Word to Specific Formats?

5. Converting floating point number to IEEE 32-bit precision floating point format

6. formatting a text box to long date format

7. HELP: Convert Number to Time and Display in 12 Hour Format

8. Date Format Style/format

9. Format for blank res. for zero Date format

10. problem with Format and a user defined date format

11. Converting floating number to the IEEE 32/40-bit precision floating point format

12. Converting a floating point number from its raw format

 

 
Powered by phpBB® Forum Software