Convert String to Date

Hi,
I work on Webi XIR2 , I was assigned with a Crystal Report job. The report is set on an old Data Base I have to mimic that report in new DB.
Im very new to CR, I just started exploring with them.Pls bare with me.I have 2 Questions

  1. I have Date which is in String Format I need to Convert to Date(mm/dd/yyyy) (In old DB its Date Format so I couldn’t mimic)

  2. I understood that If we want to Restrict Data We go to Report–>Selection Formula’s–> Record and write the where,In the Old Report,
    I couldn’t see any Filters(Where condition) ,but When I click on the View SQL button I see Lots of Where conditions and It has “Reset” ON
    I Tried to do that(Change SQLManually) ,but I couldn’t do it, All the fileds used in ther report are DataBase Fileds, No SQL/Stored Proc is used(In old and new Reports).

Can you please suggest on this, Thanks a Ton.


madhu@P (BOB member since 2008-08-04)

Hi,

To convert string use cdate function. You can CR help for more details.

When you are using tables and views to cretae your report, the SQL generated by CR is read only. You cannot modify it.

For the record selection you do not need any filters to be created. To filter the data Report–>Selection Formula’s–> Record.

Write the selection formula like this:

{Field Name}= some static value

OR

{Field Name}= Parameter, where parameter is the parameter created.

You can go through the sample reports which comes with CR for more details.

Cheers!!!
Manish


cr_manish :india: (BOB member since 2009-07-30)

Thank You Manish.

My Date is like this ‘20100101’ (For Jan 1st 2010) I said
CDate ({Table_Name.Column_Name}) -->It says bad command.

Pls advise.Thanks.


madhu@P (BOB member since 2008-08-04)

Try:

CDate({Table_Name.Column_Name}[1 to 4], {Table_Name.Column_Name}[5 to 6], {Table_Name.Column_Name}[7 to 8])

JBray :us: (BOB member since 2008-07-15)

Than You, I tried , it says

" Too Many Arguments have been given to this function"

Pls advise .Thanks a lot for the help.


madhu@P (BOB member since 2008-08-04)

Oops, sorry about that. Here are two ways I know will work. I left out some syntax on the last one:

CDate(ToNumber({Table_Name.Column_Name}[1 to 4]), ToNumber({Table_Name.Column_Name}[5 to 6]), ToNumber({Table_Name.Column_Name}[7 to 8]))

or

CDate({Table_Name_.Column_Name}[1 to 4] & "-" & {Table_Name_.Column_Name}[5 to 6] & "-" & {Table_Name_.Column_Name}[7 to 8])

JBray :us: (BOB member since 2008-07-15)

Awesome it worked perfectly!!! :+1:

Thanks a lot


madhu@P (BOB member since 2008-08-04)