Strange way... keep date in a float????

Hello everybody,
i have a big problem converting numbers to date.
The reason is that i dont understand the format or method of the save.
I now the a determined float number correspond to a date and i want to transform
de float that is keep in the oracle db to date.
Example (DD-MM-YYY)
13-10-2006 ============== 131467789
16-10-2006 ============== 131467792
14-11-2006 ============== 131468046
17-11-2006 ============== 131468049
I have tried everything (timestamp, unix timestamp, etc)
Somebody please help me
thanks

Hi,
I'm not an expert on encoding, but when you look on your examples:
A)Difference between the values for dates within the same month equals the number of days between corresponding dates (in both cases)
16-10-2006 - 13-10-2006 = 3 days
131467792 - 131467789 = 3
B)But the same is NOT true for dates in different months.
14-11-2006 - 16-10-2006 = 29 days
131468046 - 131467792 = 254
To find the encoding of months, I would need a pair of datums with the same day and year, but different months. There is none in your example, but if A) is a valid assumption, than:
valueFor(14-10-2006)=valueFor(13-10-2006)+1 = 131467789 + 1=131467790
Then:
valueFor(14-11-2006) - valueFor(14-10-2006)= 131468046 - 131467790 = 256
A magical hexadecimal number, isn't it?
So I tried converting your numbers into hexadecimal:
valueFor(14-11-2006) = 131468046 = 7D60B0E HEX
Now it's easy. Go from the end backwards and convert the bytes back to decimal:
0E HEX = 14 <= Day
0B HEX = 11 <=Month
07 D6 HEX = 2006 <= Year
It works for all the dates given by you.
So:
First (highest) two bytes = year
3rd byte = month
4th byte = day
If n is your number, then the conversion is:
day = mod(n,256)
month = trunc(mod(n,256*256)/256)
year = trunc(n/(256*256))
or the other way:
n = day + 256 * month + (256*256) * year
But as I said, I'm not an expert on encoding and you should definitely test this hypothesis on other dates and coresponding encoded values - preferrably from different months and years.

Similar Messages

  • How long do you keep data in PSA ? (SAP NetWeaver BI 7.0)

    Hello gurus,
    According to your expertise, do you consider that PSA must keep data for a long time ? Or should it be set to empty after a short time (one month for instance).
    If we consider that PSA must not keep data for a long time, how do you let your clients access old data (for instance, results of 2005 that are accessed rarely) ? Do you create another cube with old data, compressed, with aggregates ...
    I have investigating archiving, but this option does not fit because we want to be able to access the data at any time, even very rarely..
    Any feedback on the topic is appreciated.
    Best regards,
    Vanina

    Hi Vanina,
    How long you save your PSA is depending on the load frequency and the way you load:
    e.g.
    - Daily full load: one week will be enough
    - Daily delta: depending on the possibilities to repair/ to run a new init. If a repair is difficult or a init takes a lot of time (billions of records) keep your PSA for  90 days.
    Also the time the business needs to "discover" errors is important. If they run monthly reports, don't delete the PSA on weekly basis.
    If you load data from flat files or other sources that cannot be easily recovered: save PSA "forever".
    Cubes with a lot of data can be split into "Yearly" cubes. Run reports with only recent data direct on the cube. reports with this and last year on a multi-cube. (you can even make another multicube for all the years. Compress cubes once they are not filled anymore.
    Yearly cubes can also partitioned (menu --> extra's --> DB performance --> partitioning)
    Hope this helps.
    Udo

  • Keeping data in server compact database AFTER deployment

    Hey!
    I have a small problem regarding SQL Server Compact and Visual Studio 2010: My application uses a database, the purpose is to manage article stocks.
    My problem now is that I have an existing excel sheet with articles, which I want to put into the database. As of now I am  changing the code for the specific excel workSheets and the respective row indexes manually. To exemplify that: I have the workSheet[1]
    and need the content of rows 20 to 178. In my code, I am changing the workSheet index and adapt my for-loop to the right row indexes. Then I start the debugging and repeat the process for another set of rows.
    I could of course create input textboxes to enter rows and worksheet indexes to my project, so after deploying it, I can enter my desired values.
    However, out of curiousity I would like to know, if there is a way to keep data I read at debugging time in my database to use it after deployment.
    Regards
    pat3d3r

    Use a full path to your database file in your connection string, and data will persist. In addition, if you have the database file as a project item set it to Copy= Never.
    You also need to think about where you want to place the file after deployment, I have some ideas here: 
    http://erikej.blogspot.dk/2013/10/sql-server-compact-4-desktop-app-with.html
    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

  • How can I buy films in languages other than German in Germany? Quite disappointed, i would line to watch films in Original language and not dubbed in strange ways...

    How can I buy films in languages other than German in Germany? Quite disappointed, i would like
    to watch films in Original language and not dubbed in strange ways...

    You are at the mercy of the content owners/copyright holders. They decide what the Apple can sell in each iTS.
    MJ

  • How to keep date time line in  collected alert message in linux platform

    Hi Friends,
    In linux server for 11g oracle. how do I keep date time line for each error message?
    example as
    cat alert_test.log | grep 'ORA'
    grep 'ORA' alert_test.log
    I like output as
    Mon Aug 20 01:54:29 2012
    ORA-01560 caused by SQL...........
    I know we can use diag... But I want to some linux command for my debug.
    Thanks
    newdba

    Another option is to make your alert log accessible as an external table.
    Demo here:
    http://www.morganslibrary.org/reference/externaltab.html
    Find "alert log" on the page. Add a numeric column to the table and create a sequence and you can put in a surrogate row number that will allow you to pull sections using LEAD and LAG as you please.

  • How do I print to wifi printer while keeping data from cellular?

    How do I print to wifi printer while keeping data from cellular?

    If you print to a WiFi printer no Cellular Data will be used.

  • How to keep date format as dd/mm/yyyy in Agentry independent of backend value format?

    I am using Agentry 6.0.38.1 android client and 6.0.32 plugin.
    I want to keep date format as dd/mm/yyyy in Agentry independent of backend value date format.
    How can I do it?
    Regards
    -Prit

    Jason/Sravanthi
    When I log in with 6.0.38.1 android client, I get date format in dd/mm/yyyy independent of device date format (I checked by changing device date format) and when I log in with 6.0.30.x android client, I get date format in mm/dd/yyyy independent of device date format for the same export to same connection.
    Don't know why this is happening.
    Sravanthi,
    The solution you suggested didnt work
    Regards
    Prit

  • Strange Behavior with Data Merge (CS4) - Advice?

    This is the most bizarre behavior and I may have to chalk it up to a full moon or something since I can't reproduce it and I cannot find any hints as why this happened. This is my last attempt at figuring a solution...maybe someone has experienced this??? Anyway, here's what happened...
    I do a data merge for addressing envelopes. Been using the InDesign data merge feature for a couple of years now, no problems.
    My address list is approximately 1200. It's in a .csv file with the following fields: fname, lname, company, address1, address2, city, state, zip
    For my last mailing, approximately 300 addresses were merged wrong. Here's the crazy thing it did: instead of using the address1 field for the current record, it used the address1 field from the NEXT record, and ONLY the address1 field.
    Here's more bizarre-ness. The NEXT record was merged correctly.
    For example:
    Record 1 (address1 should be 555 Cherry Lane, Apt 5)
    John Smith
    Smith Company
    123 Main Street, Apt 5
    Small Town, CA 12345
    Record 2 (John Smith's address used THIS address1, but NOT address2 or any other field! Jane Doe's address is correct)
    Jane Doe
    Doe Company
    123 Main Street, Suite 300
    Big Town, TX 56789
    I've tested. I've looked for commonality in the records, where it's placed, if there was something unusual about it's format. I come up empty. The incorrect data seem randomly interspersed.
    One thing that I have to do is break up the actual merge. Either my computer memory or InDesign can't handle 1200 merge records. So, I merge approximately 200 records at a time (I make 6 print files). I don't know if this has anything to do with it (like I said, the incorrect data is interspersed all through out), but, thought I'd mention it.
    Any advice is appreciated. I'm hesitant to use it again until I can understand why this happened.
    thanks much,
    Kia

    CS was soemtimes flakey in this way with Data Merge.
    Are you updated to the latest patch? Most issues were resolved at some point.
    That said, I recall another user with this problem, and it never resolved with his particular file. I examined the data file and couldn't find any issues, but it behaved identically on my system tot he way it did on his so I can only conclude there was still some bug, or something about the data file that we were unable to detect. I seem to recall that the same data file merged correctly in CS3, but I don't recall if I saved it long enough to test in CS5. I've not had any issues with my own files in any version.
    Open the file in a plain text editor and look for any odd characters (I'd start the search where the merge first fails). Also do a Save As from the text editor to make sure there is no possibility of formatting from your spread sheet having found its way in.

  • How to keep data integrity with the two business service in OSB 10.3.1.0

    How to keep data integrity with the two business service in OSB 10.3.1.0
    In our customer system, customer want to keep data integerity between two businness service. I thinks this is XA transaction issue.
    Basing customer requirment, I created a testcase but I can't keep data integerity, For detail information, please refer the attached docs.

    Can you please explain what you meant my data integrity in your use case?
    Manoj

  • What SAP table keep data delivery address in PO document ?

    Hello everyone,
    in ME23N display PO document.
    i want to know SAP table that keep data in tab Delivery address such as Street/House number , Postal code/City
    please help.

    the delivery address in PO item is
    - the storage location address  in case the storage location is maintained in PO item AND if storage location has an address maintained in cusotmizing.
    - the plant address if no storage location is provided
    in both cases SAP knows the address number from reading the customizing, and does not need to store the number in PO item.
    - you entered a delivery  address manually in PO item. In this case an address number is stored directly in EKPO.

  • How to allow KPIs can keep data as weekly base, SSM7.5 ?

    How to allow KPIs can keep data as weekly base, SSM7.5 ?

    Chamnap,
    I would highly recommend taking some training before embarking on building models in PAS. Although the Help Guide in PAS will give you some of the information you need, I would really recommend training. While some modification of Cube Builder is possible, you do have to make those changes each time you rebuild your Cube Builder model.
    My suggestion would be to sign up for the OKP Training, which is an online training course for SSM 7.5. Being online, the course has recorded presentations and the 22 hours of material go through all aspects of SSM from the user and administration interfaces to an introduction and instruction on how to build models in PAS.
    This is the link to SAP Education and their listing of this offering:
    http://www.sap.com/services/education/catalog/globaltabbedcourse.epx?context=%5b%5bCPM_SM%7cOSM75%7c%7c%7c%7cG%7c%5d%5d%7c
    Regards,
    Bob

  • I want to keep date special month and year.

    I want to keep date special month and year.
    Example in sqlplus
    insert into area(input_time) values(to_date('MAR-04','MON-YY'));
    and select
    select input_time from area;
    the result
    01 MAR 2004
    in Oracle
    01-MAR-2004 12:00:00 AM
    I don't keep day, but I want to keep month and year.
    Can you do?
    Thanks.

    An Oracle date column must contain a date down to the second. If you don't specify a day or a time, it will default to the first of the month and midnight.
    If you want a column to only contain values at the beginning of a particular month, you can create a CHECK constraint that verifies that
    input_time = trunc( input_time, 'MM' )Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Yosemite - MacBook Air 10.10 - "Notes" does not open - "Preview" opens, but does not display PDF's - "iCal" works in new strange ways, as if no one checked its operation - Everything worked very well until Upgrade to Yosemite ! - Happen to others?

    Yosemite - MacBook Air 10.10 - "Notes" does not open - "Preview" opens, but does not display PDF's - "iCal" works in new strange ways, as if no one checked its operation - Everything worked very well until Upgrade to Yosemite ! - Happen to others?

    Thanks for your lengthy reminder dude, I have a similar Mac with yours. I suspect its a software fault because it happens after I upgraded to Lion, 10.7.2.

  • How to keep data in sleep mode

    Dear All
    Any one guide me, " How to keep data in sleep Mode". My data will be in database but it will not active when Oracle server start up.
    i am using oracle 10g r10.2.1 with window server 2003.
    Hope full response will be appreciated.
    Regards,

    some one New wrote:
    Dear All
    Any one guide me, " How to keep data in sleep Mode". My data will be in database but it will not active when Oracle server start up.
    i am using oracle 10g r10.2.1 with window server 2003.
    Hope full response will be appreciated.
    Regards,That's a very new term and AFAIK, there is no such term within Oracle. The data doesn't need to be active or inactive. Its just there when the database comes up and as long as you don't access it, it just stays there. What you can do is either to make the tablespace offline so that the data is not accessible at all or make it read only so that its not modifiable at all.
    But still, as Pierre asked, you may want to tell us exactly what you want to do.
    Aman....

  • Open a page by Firefox 5.0 then copy some texts. Close the Firefox. Try to paste texts somewhere else. Firefox can't keep data alive in windows XP clipboard...

    As I've already asked
    Why Firefox 5.0 can't keep data alive in Windows XP pro + SP3 ?
    Just test it as follows:
    1- Open a page by Firefox 5.0
    2- Copy some texts
    3- Close the Firefox 5.0
    4- Try to paste texts somewhere else (notepad, etc.)
    There is no data in clipboard if you close the Firefox 5.0

    ''the-edmeister [[#answer-666854|said]]''
    <blockquote>
    '''''"I created a second profile called Shopping. I imported the extensions from my default profile into it."'''''
    If you used Sync to do that "import", disable Sync for at least one of those Profiles.
    </blockquote>
    Thank you for your suggestion. I have Sync enabled for all the profiles. To my surprise, however, Sync was of no use in getting Default's extension collection into Shopping. For that I had to resort to the article http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox.
    I will try disabling Sync on Shopping.

Maybe you are looking for

  • My iphone 4 wont activate after i reset it

    I bought my iphone 4 used a year ago, I recently got a new phone and just wanted to use my iphone as an ipod, but now that ive reset it, its saying I cant activate it throu iTunes, and its wifi is broken, how do I activate it so I can just use it as

  • Exposure control errors when recording videos with...

    I noticed that when I record videos, the exposure sometimes is not adjusted properly. If lighting conditions change, exposure remains at the same level, and records became over or underexposed. This is especially noticeable outdoors. I have a few min

  • [SOLVED] Can't get PostgreSQL to start after following Wiki instruc...

    I'm trying to start the postgresql service on my systemd installation. I've followed the instructions on the wiki. First I installed the package postgresql, then I uncommented the PGROOT line in the configuration file. When I try to run systemctl sta

  • Xfce font change caused window/panel crash

    I just installed arch linux w/ xfce4 on my UX31A laptop for the first time yesterday.  I had everything up and going...but today I was changing my font in: Settings Manager > Appearance > Font and after testing out one of the various fonts, my deskto

  • I need help in making the programe which updates our code into client machi

    I need help in making the programme which updates our code into client machine from the server. As yahoo messanger does if there is any updated version of yahoo messanger. It asks when we login into it do you want to update new version of yahoo messa