cancel
Showing results for 
Search instead for 
Did you mean: 

Problem formatting date in Visual Composer

Former Member
0 Kudos

Hi,

I use a table view to display the results of a SQL query. The format displayed after executing the query in SQL editor is 2009-10-27 00:00:00.0 but the date displayed in the table view is 1933-03-31

I have tried formatting date using different Date Formats but the output does not seem to change.

How can i fix this

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello

Change date from in SQL server or Use date conversion function Date(Year, Month, Date)

for eg Date (1st four digits, 6th & 7th digit, Last two digits)

Dstr(Date(leftt("2009-03-29",4), Mid("2009-03-29",5,2),right("2009-03-29",2) ,"DD-MM-YYYY")

Regards

Pramod Patil

Former Member
0 Kudos

You could great a conversion bapi that would take care of that.

the bapi solution fixed your calday -> calweek issue which is not possible in VC afaik

Former Member
0 Kudos

Thanks for the response

I tried using the Date function in the formula as below.

1)Dstr(Date(left("2009-03-29",4), Mid("2009-03-29",5,2),right("2009-03-29",2) ,"DD-MM-YYYY") and I could see the results.

But when I use the date field from the table as in the formula below

1)Dstr(Date(left("YYYY-MM-DD",4), Mid("YYYY-MM-DD",5,2),right("YYYY-MM-DD",2)) ,"YYYY-MM-DD")

2)Dstr(Date(left("@CREATEDON",4), Mid("@CREATEDON",5,2),right("@CREATEDON",2)) ,"YYYY-MM-DD")

where CREATEDON is the column name in my table,I do not see the correct output.

Thanks in advance.

Vidya

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Have you tried with DSTR( ) Function?

Regards

Sandeep

Former Member
0 Kudos

Hi

Thanks for the response.

We work on EHP1 & SP2.

I tried using DSTR function :- DSTR(@CREATEDON, "YYYY-MM-DD") but it did not serve the purpose .

Regards

Vidya

Former Member
0 Kudos

Hi,

On which SP and Version you are working ?

it may Bug with your SP.

Regards,

Govindu