on 03-11-2013 3:42 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jose,
Can you try: Trunc(Date_Field,'dd')=Trunc(SYSDATE,'dd')
Thanks,
Prathamesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.