Discovering the day of the week for given date

hi guys, im trying to discover the day of the week for a given date when i do this it works fine:
select to_char(sysdate,'FMDAY') from dual
however, when i try to pass in my own value as a parameter i get the error: invalid number
select to_char(:mydate,'FMDAY') from dual .
the value im passing through to mydate is 21/02/2011 so i have no idea why it is not working. Any help would be greatly appreciated. thanks
Edited by: 786733 on 21-Feb-2011 03:41

786733 wrote:
hi guys, im trying to discover the day of the week for a given date when i do this it works fine:
select to_char(sysdate,'FMDAY') from dual
however, when i try to pass in my own value as a parameter i get the error: invalid number
select to_char(:mydate,'FMDAY') from dual .
the value im passing through to mydate is 21/02/2011 so i have no idea why it is not working. Any help would be greatly appreciated. thanksyou're probably passing in a string instead of a date, so you need to convert it to a date with the appropriate format.
select to_char(to_date(:mydate,'DD/MM/YYYY'),'FMDAY') from dual

Similar Messages

  • Find first & last day of the week from given date

    Hi All,
    I have the below input query,
    WITH TEM AS   ( SELECT '11-JAN-13' DT from dual union   SELECT '16-JUN-12' from dual union   SELECT '04-JUL-12' from dual union   SELECT '09-JAN-13' from dual union   SELECT '10-JAN-13' from dual union   SELECT '04-JAN-13' from dual union   SELECT '07-JAN-13' from dual union   SELECT '04-JUN-13' from dual union   SELECT '08-JAN-13' from dual )  SELECT TO_DATE(DT) D1,'WEEK '||TO_CHAR(TO_DATE(DT),'IW-YYYY') WK from tem;
    I would like to get the below output i.e. Starting date of the week(Saturday) & end date of the week(Friday)
    DT
    WEEK Period
    Max Date in this week
    Min Date in this week
    16-Jun-12
    WEEK 24-2012
    16-Jun-12
    22-Jun-12
    04-Jul-12
    WEEK 27-2012
    30-Jun-12
    06-Jul-12
    04-Jan-13
    WEEK 01-2013
    04-Jan-13
    29-Dec-12
    07-Jan-13
    WEEK 02-2013
    05-Jan-13
    11-Jan-13
    08-Jan-13
    WEEK 02-2013
    05-Jan-13
    11-Jan-13
    09-Jan-13
    WEEK 02-2013
    05-Jan-13
    11-Jan-13
    10-Jan-13
    WEEK 02-2013
    05-Jan-13
    11-Jan-13
    11-Jan-13
    WEEK 02-2013
    05-Jan-13
    11-Jan-13
    04-Jun-13
    WEEK 23-2013
    01-Jun-13
    07-Jun-13
    Also suggest if any function available in oracle for this one.

    Like this? I think in your required output, 3rd row data, MAX_DATE should be 29-DEC-12 and MIN_DATE should be 04-JAN-13.
    WITH TEM AS 
    ( SELECT '11-JAN-13' DT from dual union 
    SELECT '16-JUN-12' from dual union
    SELECT '04-JUL-12' from dual union
    SELECT '09-JAN-13' from dual union
    SELECT '10-JAN-13' from dual union 
    SELECT '04-JAN-13' from dual union
    SELECT '07-JAN-13' from dual union
    SELECT '04-JUN-13' from dual union
    SELECT '08-JAN-13' from dual )
    SELECT D1 DT,
           WK WEEK_PERIOD,
           CASE WHEN (TRIM(TO_CHAR(D1,'DAY'))='SATURDAY') THEN D1
                 ELSE NEXT_DAY(D1,'SATURDAY')-7
            END AS MAX_DATE_IN_THIS_WEEK,
          CASE WHEN (TRIM(TO_CHAR(D1,'DAY'))='FRIDAY') THEN D1
                ELSE NEXT_DAY(D1,'FRIDAY') END AS MIN_DATE_IN_THIS_WEEK
    FROM (
    SELECT TO_DATE(DT) D1,'WEEK '||TO_CHAR(TO_DATE(DT),'IW-YYYY') WK from tem)
    ORDER BY DT;
    OUTPUT:
    DT        WEEK_PERIOD  MAX_DATE_ MIN_DATE_
    16-JUN-12 WEEK 24-2012 16-JUN-12 22-JUN-12
    04-JUL-12 WEEK 27-2012 30-JUN-12 06-JUL-12
    04-JAN-13 WEEK 01-2013 29-DEC-12 04-JAN-13
    07-JAN-13 WEEK 02-2013 05-JAN-13 11-JAN-13
    08-JAN-13 WEEK 02-2013 05-JAN-13 11-JAN-13
    09-JAN-13 WEEK 02-2013 05-JAN-13 11-JAN-13
    10-JAN-13 WEEK 02-2013 05-JAN-13 11-JAN-13
    11-JAN-13 WEEK 02-2013 05-JAN-13 11-JAN-13
    04-JUN-13 WEEK 23-2013 01-JUN-13 07-JUN-13
    9 rows selected.

  • How to find the Day on a Week for any given Date

    Hi..... I need your help to find out the Day on a Week for any given Date .
    Say if the Date is 31/12/2009 , what would be the Day on a Week for this Date.
    Are there any fucntions available to determine the same?
    Please let me know....Thanks in Advance
    Regards
    Smita

    Hi ,
    You can using the following peice of code to get the Day of a Week for the given date :
    Calendar now = Calendar.getInstance();   
    System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1)  
         + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR));
    //create an array of days  
    //Day_OF_WEEK starts from 1 while array index starts from 0        
    String[] strDays = new String[]{"Sunday",  "Monday", "Tuesday", "Wednesday",  "Thusday",   "Friday",  "Saturday" };   
    String day_of_week = strDays[now.get(Calendar.DAY_OF_WEEK) - 1];     
    System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]  );
    Edited by: Ritushree Saha on Jun 4, 2009 1:09 PM

  • FM that gives number of day in the week for the given date

    Hi,
    I have a requirement to find the number of the day in a week for the given date. For example, 07/09/2009 is Thursday & 4th day of the week. Is there any FM to accomplish this task?
    Appreciate your help in Advance.
    Thanks,
    Kannan.

    Hi Kannan,
    ISH_GET_DAY_OF_WEEK.
    Regards,
    Dilek

  • Two or more productid will be accquired by same customerid, by same shipvia, on the same day of the week of shipped date. i want the simple query for this.

    consider this situation,
     Two or more productid will be accquired by same customerid, by same shipvia, on the same  day of the week of shipped date. i want the simple query for this.
    my tables are  from northwind:
    [orders] = OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry.
    [orders details] = OrderID, ProductID, UnitPrice, Quantity, Discount.
    i tried some but it is not exact, it gives wrong result.
    select pd.CustomerID,pd.ProductID, pd.no_of_time_purchased, sd.ShipVia, sd.same_ship_count, shipped_day from
    select ProductID,o.CustomerID,COUNT(productid) as no_of_time_purchased
    from orders o join [Order Details] od on o.OrderID=od.OrderID group by ProductID,o.CustomerID
    having count(od.ProductID) >1) pd
    join
    (select OrderID,customerid, shipvia, count(shipvia)as same_ship_count, DATENAME(DW,ShippedDate)as shipped_day from orders
    group by customerid, ShipVia, ShippedDate having COUNT(ShipVia) > 1 ) sd
    on sd.CustomerID=pd.CustomerID

    Hi,
    I think I have a solution that will at least give you a clue how to go about it. I have simplified the tables you mentioned and created them as temporary tables on my side, with some fake data to test with. I have incldued the generation of these temporary
    tables for your review.
    In my example I have included:
    1. A customer which has purchased the same product on the same day, using the same ship 3 times,
    2. Another example the same as the first but the third purchase was on a different day
    3. Another example the same as the first but the third purchase was a different product
    4. Another example the same as the first but the third purchase was using a different "ShipVia".
    You should be able to see that by grouping on all of the columns that you wich to return, you should not need to perform any subselects.
    Please let me know if I have missed any requirements.
    Hope this helps:
    CREATE TABLE #ORDERS
     OrderID INT,
     CustomerID INT,
     OrderDate DATETIME,
     ShipVia VARCHAR(5)
    CREATE TABLE #ORDERS_DETAILS
     OrderID INT,
     ProductID INT,
    INSERT INTO #ORDERS
    VALUES
    (1, 1, GETDATE(), 'ABC'),
    (2, 1, GETDATE(), 'ABC'),
    (3, 1, GETDATE(), 'ABC'),
    (4, 2, GETDATE() - 4, 'DEF'),
    (5, 2, GETDATE() - 4, 'DEF'),
    (6, 2, GETDATE() - 5, 'DEF'),
    (7, 3, GETDATE() - 10, 'GHI'),
    (8, 3, GETDATE() - 10, 'GHI'),
    (9, 3, GETDATE() - 10, 'GHI'),
    (10, 4, GETDATE() - 10, 'JKL'),
    (11, 4, GETDATE() - 10, 'JKL'),
    (12, 4, GETDATE() - 10, 'MNO')
    INSERT INTO #ORDERS_DETAILS
    VALUES
    (1, 1),
    (2, 1),
    (3, 1),
    (4, 2),
    (5, 2),
    (6, 2),
    (7, 3),
    (8, 3),
    (9, 4),
    (10, 5),
    (11, 5),
    (12, 5)
    SELECT * FROM #ORDERS
    SELECT * FROM #ORDERS_DETAILS
    SELECT
     O.CustomerID,
     OD.ProductID,
     O.ShipVia,
     COUNT(O.ShipVia),
     DATENAME(DW, O.OrderDate) AS [Shipped Day]
    FROM #ORDERS O
    JOIN #ORDERS_DETAILS OD ON O.orderID = OD.OrderID
    GROUP BY OD.ProductID, O.CustomerID, O.ShipVia, DATENAME(DW, O.OrderDate) HAVING COUNT(OD.ProductID) > 1
    DROP TABLE #ORDERS
    DROP TABLE #ORDERS_DETAILS

  • How can I change the start day of the week for weekly view?

    How can I change the start day of the week for weekly view?
    <P>
    This function is configured in the code in file <loadpoint>/CalendarServer/cal/uicust/en/main.html:
    <P>
    i18n['def first day'] = '1';
    <P>
    Note: 0 is Sunday, 1 is Monday, etc.

    Click system perferences below ur screen then click language&text and you just select ur peference langauge

  • How to determine the week for credit management?

    Is there a transaction that will show the week for which credit is determined. For example, when running RVKRED88, it shows the week the order is processed under.

    Hi Rocha,
    In Credit management S066 and S067 information structures play a vital role in updating the credit values of a customer. This works in tandem with the update group present in the OVA8 settings in case of automatic credit check.
    When an order is created S066 information structure and OEIKW field is updated which increases open order value. when order is delivered S067 information structure and OLIKW field is updated which increases open delivery value and decreses S066-OEIKW
    When delivery is billed S067-OFAKW value (Open billing)gets increased and S067-OLIKW gets decreased.
    Updation is through the information structures S066 and S067.
    In the transaction code OMO1 select the information structure and double click it. You will be faced with parameters pop-up.
    In this pop-up you have radio buttons day ,week  and Month. _Based on the value you choose here you will get day or week or month for the Period split: info structure field present just besides horizon field of dynamic credit check in OVA8 Screen_If you choose week it will be till the end of the week and if you choose Month it will be end of the month. it is how system considers.
    For example if we have created an order today i.e. 19/08/2011 and the Period split: info structure in the OVA8 has 1month.
    System evaluates dynamic credit check as today's date + one month =19/09/2011which is =30th september,2011.
    So while evaluating credit for the order, system will consider all the open orders whose  delivery date is on or before 30th september + open deliveries + open bills + A/C receivables.
    Edited by: mokirala tilak on Aug 19, 2011 11:00 AM
    Edited by: mokirala tilak on Aug 19, 2011 11:23 AM

  • Is it possible to find the Equipment for given PP work center?

    Hello PM Masters,
    Is it possible to find the Equipment for given PP work center?
    Please tell me which table will lend me the EQUNR when I have the PP work center (ARBPL).
    Thank you.

    Yes,
    Provided you maintain this value in Equipment master Location tab like this.
    And then query by this field in IH08
    Jogeswara Rao K

  • How to create a textfile dynamically(with in the loop) with given data?

    Hi all,
    Can anyone Please guide me how to create a text file in the given path dynamically? (with in the loop) with given data.
    For example:
    <%
    String data1="name";
    String data2="address";
    for(int i=0;i<10;i++)
    create the textfile at c:/test/sample.txt//name of the each file created being "sample.txt"
    //contents of text file will be
    data1+i; //to get name1,name2.....
    data2+i// to get add1,add2........
    delete(sample.txt) //to enable to create another file in the loop with same name
    %>

    The code which Ashokan mentioned is not is not creating a file.
    i used code given below to create and write into it.
    But, not is writing into it. I don't konw, where i am going worng !
    Code
    String sample2="C:/Ash/sample2.txt";     
                                                                                    FileWriter fw = new FileWriter(sample2,true);
                                            BufferedWriter bw=new BufferedWriter(fw);
                                            bw.write("EMP ID");     
                                            bw.newLine();
    Please help
    Regards
    aSh

  • What are the settings for apn data and mms for iphone 4 on straight talk?

    what are the settings for cellular data network APN DATA and MMS for Straighttalk sims on IPhone 4?I cant send or recieve pictures.My service keeps losin signal constantly saying no service then 1 bar,2 bars,3 bars...then back down to no service.It drops calls.Iv been trying to find out the answer to this problem for 2 weeks!I have no Profile selection in my settings either to do wat its showing online on one website.and have entered numerous diffrent APNs and none have worked!!!!PLEASE HELP!!!

    They're asking a question about carrier settings for their iPhone. I think that has everything to do with Apple.
    Maybe they did already ask Straight Talk. I've called Straight Talk before... they're not too helpful.
    You know, this forum would be much friendlier if people in this forum would quit squabbling, & posting comedic replies, not too mention name calling (like I did), when people are just needing some help.
    It's also frustrating that people stick up for the guy who doesn't help, but rather takes the time to post some smart alec reply. Granted, I shouldn't have name-called... some people just frustrate me when they act like that.
    Admittedly, there ARE some grey areas when it comes to carrier questions... but let the moderators do their job when someone is asking innappropriate stuff. And if the mods aren't chiming in, then that's a good indication that what the thread is about IS in fact Apple related.

  • 2-3 things to watch out for when SAP is the source for a Data Warehouse

    Hello
    What are 2-3 things to watch out for when SAP is the source for a Data Warehouse (Informatica for ETL and Cognos for reporting)?
    Thanks
    G. Vijay

    Going through some or all of this might help:
    Empty Safari's cache (from the Safari menu), then close Safari.
    Go to Home/Library/Safari and delete the following files:
    form values
    download.plist
    Then go to Home/Library/Preferences and delete
    com.apple.Safari.plist
    Repair permissions (in Disk Utility).
    Start up Safari again, and things should have improved.
    If not, MacFixit have published a very detailed (very!) article on speeding up a slow Safari, here:
    http://www.macfixit.com/article.php?story=20070416000657464
    Many, including me, have also followed the advice given by others here to add DNS codes to their Network Settings, with good results in terms of speed-up:
    Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu. Click on TCP/IP and in the box marked 'DNS Servers' enter the following two numbers:
    208.67.222.220
    208.67.220.222
    Click on Apply Now and close the window.
    Restart Safari, and repair permissions.

  • The table for storing data for infocube and ODS

    Hi all:
        could you please tell me how to find the table for storing data for infocube and ODS?
    thank you very much!

    Hi Jingying Sony,
    To find tables for any infoprvider go to SE11.
    In database table field enter the following
    Cube -
    Has fact table and dimension table
    For customized cube - ie cube names not starting with ' 0 '
    Uncompressed Fact table - /BIC/F<infocubename>
    Compressed fact table - /BIC/E<infocubename>
    Dimension table - /BIC/D<infocubename>
    For standard cube - ie cube names  starting with ' 0 '
    Uncompressed Fact table - /BI0/F<infocubename>
    Compressed fact table - /BI0/E<infocubename>
    Dimension table - /BI0/D<infocubename>
    Click on display.
    For DSO,
    For standard DSO active table- /BI0/A<DSO name>00.
    You use 40 for new table.
    Click on display.
    For customized DSO use- /BIC/A<DSO name>00.
    An easier way is in the database table field, write the name of the cube/DSO preceeded and followed by ' * ' sign. Then press F4 . It shall give you the names of the available table for that info provider.
    Double click on the name and choose display.
    Hope this helps,
    Best regards,
    Sunmit.

  • Some segments are missing in the idocs for master data zdebmas

    hi guru's,
    can any one hlep me here we facing the probelumm
    some segments are missing in the idocs for master data zdebmas
    , there is some issue on the generation of the Site Master IDoc (Message type: ZDEBMAS, Basic type: DEBMAS06).
    This is using the SAP standard program (RBDMIDOC) which reads the Site master change pointers.
    There is  some segments below is missing in the IDoc:
    how to chcek this probelumm...

    hi
    i got the function module. it is  triggerig whne i do changepointer running.
    what ever changes i made only that segments are onlycomming in to the idoc. but remaing segments are not comming.
    my req is to show all segments  even if i do changes in one segmet fields  dont change theay have send to the interfece all athe segments.i ahve to do some enhancemetns for that
    can u plse help me the login  or any function module which will fill the alla the segmetns .

  • Stock report with value and qauntity for given date not month wise

    Hi gems,
    can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location level

    Hi
    check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
    Thanks

  • Get table partition name dynamically for given date range

    Dear All,
    Could you please tell me how to get the partition name dynamicaly for given date range ?
    Thank you.

    SQL> select table_name,
           partition_name,
           to_date (
              trim (
                 '''' from regexp_substr (
                              extractvalue (
                                 dbms_xmlgen.
                                 getxmltype (
                                    'select high_value from all_tab_partitions where table_name='''
                                    || table_name
                                    || ''' and table_owner = '''
                                    || table_owner
                                    || ''' and partition_name = '''
                                    || partition_name
                                    || ''''),
                                 '//text()'),
              'syyyy-mm-dd hh24:mi:ss')
              high_value_in_date_format
      from all_tab_partitions
    where table_name = 'SALES' and table_owner = 'SH'
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE_IN_DATE_FORMAT
    SALES                          SALES_1995                     01-JAN-96               
    SALES                          SALES_1996                     01-JAN-97               
    SALES                          SALES_H1_1997                  01-JUL-97               
    SALES                          SALES_H2_1997                  01-JAN-98               
    SALES                          SALES_Q1_1998                  01-APR-98               
    SALES                          SALES_Q2_1998                  01-JUL-98               
    SALES                          SALES_Q3_1998                  01-OKT-98               
    SALES                          SALES_Q4_1998                  01-JAN-99               
    SALES                          SALES_Q1_1999                  01-APR-99               
    SALES                          SALES_Q2_1999                  01-JUL-99               
    SALES                          SALES_Q3_1999                  01-OKT-99               
    SALES                          SALES_Q4_1999                  01-JAN-00               
    SALES                          SALES_Q1_2000                  01-APR-00               
    SALES                          SALES_Q2_2000                  01-JUL-00               
    SALES                          SALES_Q3_2000                  01-OKT-00               
    SALES                          SALES_Q4_2000                  01-JAN-01               
    SALES                          SALES_Q1_2001                  01-APR-01               
    SALES                          SALES_Q2_2001                  01-JUL-01               
    SALES                          SALES_Q3_2001                  01-OKT-01               
    SALES                          SALES_Q4_2001                  01-JAN-02               
    SALES                          SALES_Q1_2002                  01-APR-02               
    SALES                          SALES_Q2_2002                  01-JUL-02               
    SALES                          SALES_Q3_2002                  01-OKT-02               
    SALES                          SALES_Q4_2002                  01-JAN-03               
    SALES                          SALES_Q1_2003                  01-APR-03               
    SALES                          SALES_Q2_2003                  01-JUL-03               
    SALES                          SALES_Q3_2003                  01-OKT-03               
    SALES                          SALES_Q4_2003                  01-JAN-04               
    28 rows selected.

Maybe you are looking for

  • Problems opening Captivate 5.5 after CTD

    Hi there forum, When closing a Captivate 5.5 project today, it asked if I wanted to save the file. I said yes. The procedure the save the project commenced and the Captivate progress box appeared as it was going through all its compression techniques

  • DVD Player crashes everytime

    Hi, I cannot launch DVD Player anymore: it crashes everytime. I deleted its preferences file, but it keeps crashing. This seems to have been happening since I updated Quicktime to 7.1.5: before I didn't crash, and it has been crashing ever since. May

  • Is it possible to transfer songs downloaded on one itunes account to a new itunes account?

    My mom and I have always shared an itunes account which used to be fine until we got iphones. Since my mom and I set up the same itunes account on our phones, I now receive all of her texts messages. The people at the verizon store said the only way

  • JDEV10g doesn't sort files on packages but sorts on directorywise

    I was trying the preview version JDEV 10g. I found a issue as below My Java files in the packages as below In <dir1> (DIRECTORY where file resides) org.home.test.abc org.home.test.abcdef In <dir2> (DIRECTORY where file resides) org.test.abc.testing W

  • No tag library could be found with this URI - MyFaces with weblogic 9.2

    I am deploying an application written using MyFaces(JSF1.1) + Tiles in weblogic 9.2. I am getting the following error when I acess any page.. Time[2009-01-28 02:02:33,039] [ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'