cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the day from SYSDATE

Former Member
0 Kudos

Hi

I need to extract the day from the sysdate function.

I know I have to use the sysdate function in a querie to create reference to a table.

when i try to extract the year or day from the sysdate i get the ORA-00904: "DATEPART": invalid identifie or

ORA-00904: "YEAR": invalid identifier or ORA-00904: "DAY": invalid identifier

Accepted Solutions (0)

Answers (4)

Answers (4)

Sujit
Active Participant
0 Kudos

Hello Jose,

Assuming you want to know the current day using todays date, you could use the following

Select to_char(sysdate,’DAY’)”Today” FROM DUAL;     - Instead of DUAL replace with your tablename.

Let me know if this helps. thanks.

Sujit Honrao

Former Member
0 Kudos

Swati Patil

No, doesnt work

I am trying usin the function CurrentDate()

Anyone know how to extract the day from a date filed or the current date function

Former Member
0 Kudos

Hello Jose,

I assume that you are using the Information Design Tool and that you are creating a single source universe. Those functions are specific to your reporting database, so you should check those. Perhaps your DB Admin can give you the functions that your reporting database offers, but anyway such functions are listed in the SQL Assistant in the Business Layer or Data Foundation.

Doing a quick search on the internet, this seems to be the syntax e.g. for an oracle DB:

TO_CHAR(cal_date,'DAY')

Best regards,

Victor

swati_patil4
Participant
0 Kudos

Hi Jose,

Where did you get the Error? In reprot or while parsing the object definition in the Universe?

If you use sysdate function to get the day in Universe and parse, you'll get the error however, if you pull the same object at report you will get the day from the system date.

Please let me know if it helps.

Thanks,

Swati

Former Member
0 Kudos

Hi Jose,

Can you try: Trunc(Date_Field,'dd')=Trunc(SYSDATE,'dd')

Thanks,

Prathamesh