BusinessObjects Board

Using of Global Variable

Hi All,

I am passing a value global variable as sysdate() which is having a fromat yyyy.mm.dd hh:mm:ss. I am using the global variable in the where clause and declaring for one column in query transformation. The column which is mapped to the source table column is having date filed of format mm/dd/yyyy. Please suggest how i can convert the sysdate format to mm/dd/yyyy so I can get the desired output.

Thanks,
Gourav


gourav (BOB member since 2010-05-22)

Summary: sysdate() returns a native datetime datatype, it has no format. You can use to_char(sysdate(), ’ mm/dd/yyyy’) to convert a datetime into a string of your format.


Werner Daehn :de: (BOB member since 2004-12-17)

Hi,

But the source field which i am mapping is a date feild,so how to proceed.


gourav (BOB member since 2010-05-22)

As said, a date does not have a format. You cannot say date <> date because the format is different. Either it is a date or a string. So let’s start one level higher: What is the error message you are getting?


Werner Daehn :de: (BOB member since 2004-12-17)

If you want to compare a date and a datetime field you will have to convert either the datetime into a date or both to a string.

In your case you could use

to_date(to_char(sysdate(), 'dd-mm-yyyy'), 'dd-mm-yyyy')

as the date value you compare your source field to.

But actually that’s all already mentioned in the link Werner gave…


HerdplattenToni (BOB member since 2011-05-13)