Srividhya.K
Srividhya.K

Reputation: 3

Crystal to SSRS conversion

DateValue(ToNumber(Mid({Command.Next_coupon_underlying_test}, 1, 4)),
    ToNumber(Mid({Command.Next_coupon_underlying_test}, 6, 2)),
    ToNumber(Mid({Command.Next_coupon_underlying_test}, 9, 2)))

I need to have SSRS Expression

Upvotes: 0

Views: 84

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21758

As you have no supplied any sample data/values I can only assume that you have a date column that contains a date as a string in the format "2022-11-30" and that you want to convert this into a real date.

If this is true then you can do one of two things.

=CDate(Fields!myFieldName.Value)

Or if you really want to replicate the functionality of your existing expression then something like this...

=DATESERIAL(
    MID(Fields!myFieldName.Value,1,4),
    MID(Fields!myFieldName.Value,6,2),
    MID(Fields!myFieldName.Value,9,2)
    )    

If this is not helpful, please edit your question and provide more information.

Upvotes: 1

Related Questions