Author Topic: How to get what Day is today(on sysdate) using PL/SQL.  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Offline shishupalsingh

  • Newbie
  • *
  • Posts: 7
How to get what Day is today(on sysdate) using PL/SQL.
« on: March 23, 2006, 12:05:17 PM »
Q.1  How can we get what is today  (is it monday, tuesday or what...??) using PL/SQL... sysdate gives only the date ??


Q.2 How can i add 48 hours in SYSDATE. I have an Item_attribute of date format and i want to assign it a value if time say 48 hrs later. how can we achieve do this ??

We can get a Date using SYSDATE (in PL/SQL) in DD-MON-YYYY format.
We can use  < select to_char(sysdate,'dd-mon-yyyy hh:mi:ss') from dual > query to get the time as well with date. But how can we add days or hrs to this characetr set. & convert it back to date format ???

Offline Matthew Searle

  • Administrator
  • Hero Member
  • *****
  • Posts: 920
    • WorkflowFAQ
Re: How to get what Day is today(on sysdate) using PL/SQL.
« Reply #1 on: March 23, 2006, 01:02:39 PM »
Hi,

Quote
Q.1  How can we get what is today  (is it monday, tuesday or what...??) using PL/SQL... sysdate gives only the date ??

select to_char(sysdate,'DAY') from dual

Quote
Q.2 How can i add 48 hours in SYSDATE. I have an Item_attribute of date format and i want to assign it a value if time say 48 hrs later. how can we achieve do this ??

select to_char(sysdate + 2,'DD-MON-YYYY HH24:MI:SS') from dual

HTH,

Matt
View my online profile on LinkedIN: http://www.linkedin.com/in/mattsearle
Have you read my blog? http://www.workflowfaq.com/blog