Forum Discussion

AdamKeever1's avatar
AdamKeever1
Qrew Commander
5 years ago

Date in Number Format

I have a case in which in excel I convert several date fields to the number formatted date in order create a unique numeric key field.

Any suggestions on how to do this in Quick Base?

------------------------------
Adam Keever
------------------------------

6 Replies

  • Not sure what you mean by "number formatted date"?  Do you mean the DATEVALUE function in Excel?

    This is not the same thing - but you could find out the number of seconds since a certain starting time, and use that number.

    In this example Formula Numeric - the "start" is 1/1/1970, and the "end" is the current time, and the it returns the # of seconds.  

    You can change the StartDateTime and EndDateTime variables in the first two lines to adjust the dates.

    var DateTime EndDateTime = Now();
    var DateTime StartDateTime = ToTimestamp(Date(1970, 1, 1));
    
    var Number NumSeconds = ToSeconds( $EndDateTime - $StartDateTime );
    
    $NumSeconds​



    ------------------------------
    Xavier Fan
    Quick Base Solution Provider
    http://xavierfanconsulting.com/
    ------------------------------
    • AdamKeever1's avatar
      AdamKeever1
      Qrew Commander
      Hello Xavier,

      Yes, I am referring to the Microsoft Excel date-time code. Here is an example of how I am generating a unique ID that can be used as a key field:


      I want to have the data in a table in Quick Base and set the code as the key field so that I can use the import with updates function to add records and update modified records.


      ------------------------------
      Adam Keever
      ------------------------------
      • hhersch's avatar
        hhersch
        Quickbase Staff
        Hey Adam - we would definitely suggest keeping our native key fields wherever possible both for functionality and performance. You mention wanting to handle import with updates, have you tried our "Merge Field" feature we rolled out earlier this year? Is there a feature gap with that?

        ------------------------------
        Harrison Hersch
        ------------------------------