Conversion of  Date to a Number

Hi,
I have a Parameter "Start Date" in date format  MM/DD/YYYY (Date).
I have to convert this to a Number so that it matches with the data type of my column "Submission_Time_Id" which is in YYYYMMDD (bigint)
So that I can use this parameter in my Select Expert
Any Idea?

totext("yyyyMMdd"
make sure your year and day is lower or it wont work

Similar Messages

  • Conversion of Date into Number of Days

    Hai All,
               Can anyone pls tell how to convert the Date format into Number of days.
    For example I have 2 dates, 25.03.2009 and 25.02.2009.
    I have to take the difference of these two dates, means its 30 days.
    Later I have to move this 30 days to a variable and display.
    Can anyone help me.

    Try these FMs.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    i_datum_bis = p_sdate
    i_datum_von = p_edate
    IMPORTING
    e_tage = l_differ
    EXCEPTIONS
    days_method_not_defined = 1
    others = 2.
    WRITE:/ l_differ.
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    exporting
    i_date_from = p_sdate
    i_date_to = p_edate
    I_FLG_SEPARATE = ' '
    IMPORTING
    E_DAYS = EDAYS
    E_MONTHS = EMONTHS
    E_YEARS = EYEARS.
    WRITE:/ No of Days ', EDAYS.
    Regards,
    Joan

  • How to convert amount data element to number data element

    Dear Gurus,
    I have a requirement to get the data by calling BRF+ and then pass them to BAPI 'BAPI_ASSET_ACQUISITION_POST', in the BRF+ export structure, there is a field 'AMOUNT', I bind it to DDIC element 'BF_ANBTR', the type is Number.
    In BRF+, I call another global function to calculate the value, I define a local variant LV_VALUE to get export value from this function, this local variant's type is Amount, now I need to move this local variant value to the export field 'AMOUNT'.
    But BRF+ doesn't allow to convert amount data element to number data element directly, and I find there is no formula function available. Only there is a function 'TO_AMOUNT' to convert number data element to amount data element.
    Please help to get a solution for above solution.
    Thanks.

    Hi,
    within the formula expression within the category "Mathematical functions" you will find the function "TONUMBER". This converts a data element of type currency to a number. According to the help of this function:
    "The following conversion rules apply:
    <Amount>: The number part is returned. The currency unit is omitted."
    This is what you are looking for.
    For the other way round you already mentioned the correct function "TO_AMOUNT"
    BR
    Christian

  • Open conversions in data dictionary

    Dear experts,
    We have been trying to install an ST-PI package in an SAP system.However,it gives a warning saying "Open conversions in data dictionary". It says - Some open conversion requests still exists for the following ABAP data dictionary objects.To avoid inconsistencies and data losses you must process these conversions first. 
    Further it asks us to run the transaction SE14 which points towards the table GLPCA and says Index Z1 does not exist.
    What can be the cause behind this?I do not have an ABAP background.So,hoping if you could help me out.
    Regards,
    Minuj
    Edited by: minuj sarma on Feb 22, 2008 2:12 PM

    hi  sagar,
    Go to transaction SE14 and choose the following options in the menu
    DB requests --> Terminated
    Reward points if usefull,
    Thanks,
    Kalyan.

  • ORA-00932: inconsistent data types: expected NUMBER got BINARY

    ORA-00932: inconsistent data types: expected NUMBER got BINARY
    Hi,
    Could anyone help in resolving my problem?
    I ‘m developing cmp beans in Jbuilder X,
    My database is Oracle 10g, running on Linux and Application server is Oracle10gAs. Running on Windows.
    I can deploy my Entity EJB’s OK and look then up using finder methods as long as I’ve created the data directly in the database using SQL*Plus for instance.
    In the database I have my primary keys defined as type NUMBER
    In my EJB the corresponding number fields get mapped as java.math.BigDecimal.
    which according to the Oracle JDBC specification is how they are mapped.
    Problem:
    When I try to create a new database entity through my EJB entity bean I get:-
    Error "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY".
    The value of the number being used as the primary key in this example is 10.
    Eg:-
    BigDecimal pk = new BigDecimal(10);
    TestBean test = home.create(pk);
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriverand url="jdbc:oracle:thin..." in the connection.
    I’ve even tried mapping a datatype as described in the Oracle FAQ’s but this didn’t work.
    21.     I'm trying to deploy a CMP entity bean with a field type BigDecimal and the table creation fails with an error. How do I work around this?
    You have to perform the following steps prior to deploy your application.
    o     Define the mapping for java.math.BigDecimal in the database-schemas/oracle.xml as follows:
    <type-mapping type="java.math.BigDecimal" name="number(20,8)" />o     Use this schema in your data-source as follows:-
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="OracleDS"
    ejb-location="jdbc/OracleDS"
    schema="database-schemas/oracle.xml"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@localhost:1521:DEBU"
    clean-available-connections-threshold="30"
    rac-enabled="false"
    inactivity-timeout="30"
    />

    Further clarification of my problem.
    Originally I said the error occurred when deploying EJB's
    Correction: I can deploy them OK on the application server However the Error message occurs when I try to create a new EJB entity, the only value required is the Primary key which I pass as type BidDecimal.
    If I create entries directly in the database my EJB findByPrimaryKey can find entities OK.
    But I cant create new ones through EJB.
    What realy baffels me is why I'm able to read data through the connection but not write.
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriver
    and url="jdbc:oracle:thin..." in the connection.

  • Implicit Conversion from data type sql_variant to datetime is not allowed.

     Getting a odd error. This code was working perfectly before a SQLServer upgrade.
    The linked database is working, I'm able to pull up data from it in separate queries just fine.
    I'm getting the following error.
    Implicit conversion from data type sql_variant to datetime is not allowed. Use the CONVERT function to run this query.
    Invalid column name 'TotalDay'. (.Net SqlClient Data Provider)
    can anyone spot the issue? I've tried sever variations of the same code, but still get the same thing.
    If I put this section in a query by it self it works just fine.
    ( DATEDIFF(ss,
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X3
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X3.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate ASC
    ),101),
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X4
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X4.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate DESC
    ),101)) ) AS TotalDayBadge ,

    >ANDCONVERT(VARCHAR(10),X3.TimeDate,101)=CONVERT(VARCHAR(10),@sdate,101)
    It is not a good idea to use string dates for predicates in WHERE clauses.
    Use DATETIME or DATE in predicates.
    If you are not interested in the time part of DATETIME, use DATE datatype.
    Example:
    SELECT CONVERT(DATE, getdate());
    -- 2014-08-25
    Datetime conversions:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Between dates:
    http://www.sqlusa.com/bestpractices2008/between-dates/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Date from Day number and year

    Dear experts,
    i have day number and year ,i wanted to identify the date
    ex: day number=203 year=2009
    date:22/07/2009
    please advice the best possible way to acheive this.
    thanks

    Florian:
    Given that the OP said his fields were VARCHAR2, and his sample data showed leading zeroes, your original solution will work as posted. If the data had been numeric, another solution would be to just reverse the order of the components.
    SQL> WITH t AS (
      2     SELECT 2009 yr, 203 day_no FROM dual union all
      3     SELECT 2006, 201 FROM dual union all
      4     SELECT 1999,  99 FROM dual union all
      5     SELECT 2000, 001 FROM dual union all
      6     SELECT 1945, 100 FROM dual union all
      7     SELECT 1921, 101 FROM dual)
      8  SELECT TO_DATE(yr||day_no, 'yyyyddd') dt FROM t;
    DT
    22-JUL-2009
    20-JUL-2006
    09-APR-1999
    01-JAN-2000
    10-APR-1945
    11-APR-1921It is the way that format masks are applied that causes his. With your mask and numeric iinput, it is taking the first 3 digits as the day number, in your example 902, then the remainder of them as the year, in your example 9. Obviously, the number of days in a year is never more than 366.
    By reversing the mask, the first 4 digits are taken as the year, and the remainder are taken as the day number.
    John

  • Add a date to decimal number

    hello
    pls tell me how to add a date to decimal number as
    4 years and 3 months for example ?
    EX.
    ===
    1/1/2001
    +
    4 years and 3 months
    Regards,
    Abdetu...

    If you want a specific result, then post your desired result...we don't know your desired format mask.
    In case it's yyyymmdd:
    SQL> select to_date('1/1/2001', 'dd/mm/yyyy') dt
      2  ,      add_months(to_date('1/1/2001', 'dd/mm/yyyy'), 51) dt2
      3  ,      to_number(to_char(add_months(to_date('1/1/2001', 'dd/mm/yyyy'), 51), 'yyyymmdd')) num
      4  from   dual;
    DT                  DT2                        NUM
    01-01-2001 00:00:00 01-04-2005 00:00:00   20050401
    1 row selected.

  • I iPad 3 fails to recognize cellular data In a number of locations Displays "searching and No Service" I have narrowed this to device problem. What can I do?

    i iPad 3 fails to recognize cellular data In a number of locations Displays "searching and No Service" I have narrowed this to device problem. What can I do?

    Hello there, OSOSANYA.
    The following Knowledge Base article provides a great checklist of steps and additional recommendations for troubleshooting issues with cellular connection:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Follow these steps for help troubleshooting cellular data issues on your iPhone. After performing each step, please test to see if the issue is resolved.
    Toggle airplane mode: Tap Settings, turn airplane mode on, wait three seconds, and then turn off again.
    Restart your iPhone.
    Make sure that your software is up to date:
    Check for a Carrier Settings Update: Tap Settings > General > About.
    Check for an iOS Software Update: Tap Settings > General > Software Update.
    Note: Some updates may require a Wi-Fi connection.
    Remove the SIM Card and reinsert it. Allow the iPhone to acquire the network again.
    If your SIM card has SIM PIN enabled, try turning it off: Tap Settings > Phone > SIM PIN.
    Try another location. If a different location works, but the original location still doesn't, contact your carrier to report the issue.
    Reset network settings: Tap Settings > General > Reset > Reset Network Settings.
    Restore the iPhone as new.
    Contact your carrier to:
    Verify that the iPhone is properly set up on the account with the appropriate, current data plan.
    Verify that there are no account-related blocks.
    Find out if there are specific error messages in the carrier logs that could help determine why the issue is occurring.
    If none of the above steps resolves the issue, contact your carrier, make an appointment at an Apple Retail Store, or contact AppleCare to troubleshoot further.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • GR date as batch number

    Hi Experts,
    I have a situation where I should configure the system, so system should automatically create batches at the time of GR and the batch number should be GR date (27102001)
    Please suggest.
    R.S

    I dont know for what reason you use batch managment. We are doing it for quality reasons.
    if we get 2 batches of the same material from our vendor, we usually have slightly different quality data, hence we create as well 2 batches in our system.
    I kow it is possible that each material can have the same batch number. but if you just use the date as batch number, then you can only have one batch per material and day. so you could never manage above mentioned case.
    Maybe it is not a problem with your materials, and you just want 1 batch despite of having serval receipts of the same material on the same day.......but if you have to distiguish, then you need more than just the date, maybe an additional character like A or B or -001 and -002

  • Stock data of serial number not suitable for movement

    We have a situation where we have had to put some serialized parts on a rework production order.  When we are trying to bring them back into stock, we're getting a message that says "Stock data of serial number not suitable for movement."  I'm guessing that this is because this serial number had existed in stock before (since this is a rework of an existing material/serial number.)  We need to receive this back into stock using this same serial number. How is that possible?
    Thanks in advance for your help.
    Sybil

    Dear,
    Please refer these threads,
    Re: Removing Serial number Profile
    IQ02 Shows Blocked Stock for Serial Number
    Hope it will help you.
    Regards,
    R.Brahmankar

  • IO231: Stock data of serial number &1 not suitable for movement

    Hi experts,
    I have unique problem with serialized material posting.We are having serialized managed materials which are posted to quality inspection stock.The user was able to post partial quantity to unrestricted after usage decision but when tried to post remainig quantity it is giving error 'IO231: Stock data of serial number &1 not suitable for movement".I checked serial number history in iq02 & it shows that same serial numbers were used for some order in the past which is already delivered.I am not able to understand how it allowed to post same serial numbers again for the same material and if it is normal why it is giving above error when we try to post remaining quantity?
    I tried by changing serial profile in the material master with all optional fields and without stock check and equipment and try to post but its not working.
    I want to somehow post material to unrestricted use from quality inspection with or without serial numbers.
    I am working on 4.7 system
    Can u guys help me.
    Thanks & Regards,
    Sachin.

    Hi,
        Please check this SAP Note: 213861, 1229108
    From Note 213861
    Release 4.0A or 4.0B:
    Table T156S
    Maintain the data using Transaction SM31.Flag for transport using Transaction SE16.
    All entries for movement types 645 and 647 should be filled with '****' in field T156S-VRGNG.
    Release 4.5A or 4.5B:
    Table T156S
    Maintain the data using Transaction SM31.Flag for transport using Transaction SE16.
    All entries for movement types 645, 647 and 675 to 678 should be filled with '****' in field T156S-VRGNG.
    Release 4.6A to 4.6C:
    Table T156SY
    Maintain the data using Transaction SM30 using view V_T156SY.If necessary, manually flag for transport in this transaction.
    All entries for posting string references 645 or 647 should be filled in field T156SY-VRGNG_S or T156SY-VRGNG_H with '****'.
    For Note 1229108
    A correction instructions has given Please take help from BASIS Team....
    This will solve the Problem...
    Regards
    GK.
    Edited by: Gnana Kumar on Nov 3, 2010 7:16 AM

  • Stock data of serial number 90645 not suitable for Movement.

    HI Friends,
    We are having issue while doing return delivery for a service/Repair order, the serial number related error messages are coming.
    the error messages are
    1. Stock data of serial number 90645 not suitable for Movement.
    2 . Serial number can not be used here.
    3  termination of gods issue posting for delivery note 855222.
    The following points explain the scenario..
    1. The Previous and next documents are through with the post Goods receipt for the same  material with different serial numbers.
    2. The movemnt is 653 E
    3   Client placing one service/repair order and creating return delivry against this order and assign serial number and trying to post Goods receipt.
    4  The serial number profile is having Exist/ indicator for SDRE return delivery serial usage is 'optional' and Equipe' with equirement'
    Robert

    Hi Anybody come across this requirement.

  • "You can't compare a date with a number" in a formula that worked in Excel

    I opened in Numbers an invoice file which was created in Excel. Formula returns hours worked. It has an "if" condition for the date field. I am assuming that that is the reason I get this "You can’t compare a date with a number because their data types are different." What do I do?
    Formula reads =IF(SUM(A11)>0,(D11−C11),"") where A11 is a date and D11- C11 are times, ie 4PM and 5PM
    Message was edited by: iamzoran

    Jerrold Green1,
    I agree with your words about using Sum with a single cell [have no idea why the "creator" of the file did that]; same for the parentheses enclosing subtraction. Yet cleaning it up as you showed me [=IF(A11>0,D11−C11,"") ] I got the same comment
    "You can’t compare a date with a number because their data types are different."
    Makes me think that t quinn is on to something with his "think the issue is with the expression ">0". Could it be that >0 is the number referred to and <>"" and ISBLANK are not numbers?!
    z
    PS: I am so happy that I am able to use Spelling and Grammar Checker with Safari on these posts. I was born and raise in old Yugoslavia and I use the Checker with all my emails etc and its a life saver. hahaha

  • Disallowed implicit conversion from data type datetime to data type timestamp

    Received error: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Disallowed implicit conversion from data type
    datetime to data type timestamp, table 'myTbl', column 'duration'.
    Use the CONVERT function to run this query.
    I have a field named duration hh:mm:ss.lll that I am trying
    to insert into MS SQL. DB has field defined as [duration]
    [timestamp] NOT NULL,
    My insert has this: INSERT INTO myTbl( duration) VALUES(
    <cfqueryparam value="2006-05-26 11:12:13"
    cfsqltype="CF_SQL_TIMESTAMP"/> )
    Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with
    seconds as 13.111 which did not work. Does the db duration need to
    be date? I just want to store a duration for the time of a movie...
    10 Q

    quote:
    Originally posted by:
    quiet1
    Received error: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Disallowed implicit conversion from data type
    datetime to data type timestamp, table 'myTbl', column 'duration'.
    Use the CONVERT function to run this query.
    I have a field named duration hh:mm:ss.lll that I am trying
    to insert into MS SQL. DB has field defined as [duration]
    [timestamp] NOT NULL,
    My insert has this: INSERT INTO myTbl( duration) VALUES(
    <cfqueryparam value="2006-05-26 11:12:13"
    cfsqltype="CF_SQL_TIMESTAMP"/> )
    Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with
    seconds as 13.111 which did not work. Does the db duration need to
    be date? I just want to store a duration for the time of a movie...
    10 Q
    Duration as a timestamp? How odd, most people would store it
    as an integer. Or, if you want to build your own string, the syntax
    is {ts 'yyyy-mm-dd hh:mm:ss'}. The seconds might not be required.
    In any event, use createodbcdatetime() for the value you want
    to put into your table.

Maybe you are looking for

  • T510: Can't load Windows 7, Keeps rebooting only works in safe mode

    Trying to get my T510 up and running after my W520 went DOA after a bios update.  When i power on the laptop it tries to load Windows 7 then goes into a rebooting loop.  I can get into safe mode with networking just fine without issues, so i figured

  • Album and artist title larger than other album titles?

    When viewing my music through grid view and sorting by albums one of the titles for one of my albums have a larger font size than any of the other in my library. It's not the selected or the currently played album. It's the first of a few albums of t

  • Weblogic crashes with a coredump on solaris

    Hi All, Recently our weblogic server on solaris started to give core dumps. It doesnt say why it crashed and the only available information are the coredump file and the log file which is created for that crash. One other noticable thing was somewher

  • Finder Focus issue

    In the last couple of days my Mac has started highlighting the default or focused item in the finder and other applications with a dark black rectangular outline. I can't figure out what has caused it, or how to turn it off. Help!

  • Language translation of Condition text

    Hi Friends, I am working on an Implementation Project & would need your inputs on the following requirement: Condition Texts are maintained in ECC at a Condition Record level. This is maintained in English and would be uploaded using a BDC / LSMW pro