Convert Mydate field from Character to date

Hi All

I have a data object which is type Character at Universe level (Mydate) using SQL Server. As mentioned Mydate is format Character and its output is yyyy.dd.mm.

How do convert this to a date format so its works at report level when used in a prompt

See attached, where I believe I am need to amend

Many thanks for any help
Sims

Hi Sims,

Welcome to B :mrgreen: B.

Try this, CAST(SALESDATE as date).

Thanks,
Mohammed

1 Like

Hi Mohammed

Thanks for coming back…Appreciated…Used CAST(SALESDATE as date).See 2nd Attachment and the field date comes out as

eg 2021-08-26. In the report I an unable to use this in a user prompt as user is not able select via Parameter as it still recognises it as a Type Character

I then tried to amend the Type format of object to Date and get the non-compatible message.

Again , thank you for your assistance

Jzk

Zahed

Hi Zahed,

As you’ve used the Cast function to change it to Date, please change the Type (in drop down) from Character to Date, that should work.

Thanks,
Mohammed

Hi Mohammed

I did try that and got the following error , see attached

Have I possibly missed a step ?

Again , many thanks

Hi Mohammed

Apologies , it now works. You;re a great help

Jzk
Sims

1 Like