Sign Up

Hey, Dev!
Are you looking for a forum full of active developers to help you?
So if you want to:
➡️ Get answers for your development issues
➡️ Help others
➡️ Write an article
➡️ Get rewarded for your active participation
Then you are going to love this place.

Have an account? Sign In


Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • About
Home/Questions/Q 4471
In Process
Bheem
Bheem

Bheem

  • 9 Questions
  • 5 Answers
  • 0 Best Answers
  • 69 Points
View Profile
  • 0
BheemProfessional
Asked: January 11, 20212021-01-11T10:14:34+05:30 2021-01-11T10:14:34+05:30

Extract Date & Time form finger print machine

  • 0

Hi Sir,

how to extract date & time , emp id from this column. this is output from fingerprint machine. to track emp attendance.

080121161350 00000001

I want output :

Date & Time :08-01-21 16:13:50

Emp : 00000001

oracle apex
  • 4
  • 48
  • 0
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
Answer

    4 Answers

    1. Vinish

      Vinish

      • 1 Question
      • 416 Answers
      • 39 Best Answers
      • 2k Points
      View Profile
      Vinish Legendary
      2021-01-11T10:26:13+05:30Added an answer on January 11, 2021 at 10:26 am

      There is a space between two values, you can extract on this behalf. Below is an example:

      Declare
        v_whole_string varchar2(100);
        v_date varchar2(50);
        v_empid varchar2(50);
        d_date date;
      Begin
        v_whole_string := '080121161350 00000001';
        v_date := substr(v_whole_string, 1, instr(v_whole_string, ' ')-1);
        v_empid := substr(v_whole_string, instr(v_whole_string, ' ')+1);
        d_date := to_date(v_date, 'ddmmyyhh24miss');
        dbms_output.put_line(v_date);
        dbms_output.put_line(v_empid);
        dbms_output.put_line(d_date);
      End;
      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
      • Bheem

        Bheem

        • 9 Questions
        • 5 Answers
        • 0 Best Answers
        • 69 Points
        View Profile
        Bheem Professional
        2021-01-11T10:31:01+05:30Replied to answer on January 11, 2021 at 10:31 am

        Thanks for the immediate reply. Everything working fine but time is missing.

        • 0
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
        • Bheem

          Bheem

          • 9 Questions
          • 5 Answers
          • 0 Best Answers
          • 69 Points
          View Profile
          Bheem Professional
          2021-01-11T11:54:36+05:30Replied to answer on January 11, 2021 at 11:54 am

          Got it

          Declare
          v_whole_string varchar2(100);
          v_date varchar2(50);
          v_empid varchar2(50);
          d_date varchar2(50);
          Begin
          v_whole_string := ‘080121161350 00000001’;
          v_date := substr(v_whole_string, 1, instr(v_whole_string, ‘ ‘)-1);
          v_empid := substr(v_whole_string, instr(v_whole_string, ‘ ‘)+1);
          d_date := to_timestamp(v_date, ‘ddmmyyhh24miss’);
          dbms_output.put_line(v_date);
          dbms_output.put_line(v_empid);
          dbms_output.put_line(d_date);
          End;

          • 0
          • Share
            Share
            • Share on Facebook
            • Share on Twitter
          • Vinish

            Vinish

            • 1 Question
            • 416 Answers
            • 39 Best Answers
            • 2k Points
            View Profile
            Vinish Legendary
            2021-01-11T13:49:48+05:30Replied to answer on January 11, 2021 at 1:49 pm

            To view the time you need to use the to_char() function:

            dbms_output.put_line(to_char(d_date, 'dd/mm/yy hh24:mi:ss'));

             

            • 0
            • Share
              Share
              • Share on Facebook
              • Share on Twitter

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask Question
    Write a Post
    • Recent
    • Answers
    • Bheem

      What is best way to design school time table?

      • 0 Answers
    • OrclQA Wiki

      How to display file contents in MAC terminal app?

      • 1 Answer
    • Greg

      Displaying image in modal window

      • 3 Answers
    • Greg Grimes

      20.2 APEX: How can I pre-select the searchable column in ...

      • 0 Answers
    • ApexPadawan
      ApexPadawan added an answer Have you tried using the built in file browse item,… January 21, 2021 at 1:29 pm
    • ApexPadawan
      ApexPadawan added an answer First Add the following to CSS > Inline under Page… January 21, 2021 at 1:21 pm
    • Vinish
      Vinish added an answer Yes, this is also fine. January 19, 2021 at 3:25 pm
    • Greg
      Greg added an answer I tried your solution and it worked, but since I… January 19, 2021 at 3:23 pm
    • Vinish
      Vinish added an answer You can use the cat command to display file contents… January 19, 2021 at 10:41 am

    Recent Blog Posts

    • Vinish

      Copy URL to Clipboard on Button Click Examples

    • Vinish

      Find When Your Mac Was Last Shutdown

    • Vinish

      Oracle SELECT Statement

    • Vinish

      Python Append List to List Example

    • Vinish

      JavaScript Object Get Value by Key

    Explore

    • Home
    • Blog
    • New Questions
    • Tutorials
      • Oracle Apex
      • Python
    • Tags
    • Users
    • Badges & Points
    • About

    © 2020 OrclQA.Com. All Rights Reserved. Privacy Policy