Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

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

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:15:00+00:00 2026-06-13T10:15:00+00:00

I have a program that inserts some data into a table. In my table

  • 0

I have a program that inserts some data into a table.

In my table im showing day and week number like the following output (in danish)

TO Uge 42

Where TO is the name of the day

Uge is week

and 42 is the number of the week.

What i would like to do is get the TO to be TOR(Short for Torsdagwhich is the danish word for Thursday)

My Code looks like this at the moment:

"DY' || ' ' || '\"Uge\" '|| 'IW";

Are there any whay in Orcle where i can get the date as a 3 lettered String or do i have to make substrings of the string and change it?

UPDATE ADDED SQL CODE FROM MY PROGRAM

String sql =
            "SELECT                                                                     " +
            "   TO_CHAR(MIN(TIDSPUNKT),'"+getDateDescriptionFormat(when)+"') AS PERIOD, " +
            "   NVL(QUEUE,' ') AS QUEUE,                                                " +
            "   NVL(SUM(ANTAL_KALD),0) AS CALLS,                                        " +
            "   NVL(SUM(ANTAL_BESVARET),0) AS ANSWERED_CALLS,                           " +
            "   NVL(SUM(BESVARET_25_SEK),0) AS ANSWERED_CALLS_25_SEC,                   " +
            "   NVL(SUM(INTERN_KALD),0) AS INTERNAL_CALLS                               " +
            "FROM                                                                       " +
            "   KS_DRIFT.PERO_NKM_KØ_OVERSIGT                                           " +
            "WHERE                                                                      " +
            "   TIDSPUNKT >= '"+getStartDate(start,when)+"' AND                         " +
            "   TIDSPUNKT <= '"+ slut+"' AND                                            " +
            "   TO_CHAR(TIDSPUNKT,'DY') NOT IN ('AB')                                   " +
            "GROUP BY                                                                   " +
            "   TRUNC(TIDSPUNKT,'"+getDateFormatString(when)+"'),                       " +
            "   QUEUE                                                                   " +
            "ORDER BY                                                                   " +
            "   PERIOD  

THE getDateDiscribtionFormat:

private String getDateDescriptionFormat(char when){
        if (when == 'D')return "DY' || ' ' || '\"Uge\" '|| 'IW";
        if (when == 'W')return "\"Uge\" '||'IW";
        if (when == 'M')return "Mon.' || ' ' || 'YYYY";
        if (when == 'Y')return "YYYY";
        return null;
    }

Do note that I DID not make this code my former co worker did and it is messy !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:15:01+00:00Added an answer on June 13, 2026 at 10:15 am

    Looks like there is no other format model that will do what you want. ‘DY’ gives the “abbreviated name of day” — in my English-language system this means a three-letter abbreviation, but I guess in your language the standard abbreviation is two letters.

    Rather than doing a substring, I’d suggest converting to a numeric day of the week and then simply having a mapping, for example (using English abbreviations):

    CASE TO_CHAR(sysdate,'D')
      WHEN 1 THEN 'SUN'
      WHEN 2 THEN 'MON'
      WHEN 3 THEN 'TUE'
      <et cetera>
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a table with a CreateDateTime PK. The program that does the inserts
i'm trying to make a program that inserts data into specific places in existing
I need to insert some data into a table. When program executes to insert,
i have a problem in inserting some data into a table. I have done
I have a Datatable in my C# program that I would like to INSERT
I have program that runs fast enough. I want to see the number of
I have a program that has a ton of sensors producing data at a
We have a program on our AS400 that takes in a number, encrypts it
I wrote an application that inserts some data in a SQlite database using JDBC
I have the following scenario: a table that is accessed (update, delete, insert and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.