Format code cannot appear in date input format - IW related

Hi,
please explain what I'm doing wrong:
SQL>  select to_char(sysdate, 'YYYY-IW') from  dual;
TO_CHAR
2010-48
SQL>  select to_date('2010-22', 'YYYY-IW') from  dual;
select to_date('2010-22', 'YYYY-IW') from  dual
ERROR at line 1:
ORA-01820: format code cannot appear in date input formatOracle 9.2 .
Regards.
Greg

FIrst of all you should stay with the date format. Instead of converting it into a string you could TRUNCATE it to the first day of the Iso-Wekk.
And to enable index usage you just have to put a certain range on your queries.
example
select *
from t
where col_date  >= trunc(sysdate, 'IW')  ;if col_date can hold values that are greater than syste. Or if you use another date value to compare than sysdate. Then you need to compare with a range. Just like this
select *
from t
where col_date  >= trunc(sysdate, 'IW') 
and col_date  < trunc(sysdate, 'IW')+7 ;If you want to input a certain WEEK and get all entries from that week you can start with the first day of the iso-Year and add the number of weeks to it.
example using iso-Week 40
select *
from t
where col_date  >= trunc(sysdate, 'IYYY')  + 7 * 40
and col_date  < trunc(sysdate, 'IYYY')+7 * (40 +  1);However calendar arithmetic is complex. We have to be careful for special cases. For example the beginning of the ISO-Year 2011 is the 3rd Jan 2011. So if we run this logic on the first or second of January *2011* we would get the calendar week 40 from *2010*. This is probably not what you want.
To take this into account we must make sure that we are using the proper year. There are several possibilities how to do it. In this case I choose to use the normal TRUNC to get the first day of the normal year (1.1.2011) then add a week and truncate again.
example
select *
from t
where col_date  >= trunc(trunc(sysdate,'YYYY)+7, 'IYYY')  + 7 * 40
and col_date  < trunc(trunc(sysdate,'YYYY)+7, 'IYYY')+7 * (40 +  1);Edited by: Sven W. on Dec 3, 2010 8:52 AM

Similar Messages

  • ORA-01820: format code cannot appear in date input format

    I don't understand why I am getting the error below. That should be valid, no?
    TIA for any insight.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    SQL>
    SQL> select to_date('2004 01 3','yyyy mm w') from dual;
    select to_date('2004 01 3','yyyy mm w') from dual
    ERROR at line 1:
    ORA-01820: format code cannot appear in date input format
    SQL>
    SQL> select to_char(sysdate,'yyyy mm w') from dual;
    TO_CHAR(S
    2008 08 1

    LC,
    ORA-01820:     format code cannot appear in date input format
    Cause:     A date specification contained an invalid format code. Only the following may be specified when entering a date: year, month, day, hours, minutes, seconds, Julian day, A.M./P.M. and B.C./A.D.
    Action:     Remove the invalid format code from the date specification.
    Looking at the cause,you can't use a format code like W in the date format for converting a text to date. To_date doesn't accept it.
    Aman....

  • GregorianCalendar datetime format convert to  sql server date time format

    please help me
    my GregorianCalendar date time format is like this. *08/01/29 02:25:59* . I try to insert my database(sql server 2000 )
    data type is datetime ,in my database table display like this *2029-08-01 02:25:59.000* .can you help me to insert correct date in my database table like ( . *08/01/29 02:25:59*)

    use [PreparedStatement |http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html] and setTimestamp:
    [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html]

  • How to get date in format(1st jan 2006 ).

    can we get get the date in the 1st jan 2006 format .
    we can get the date in format 1 jan 2006 by using (d MMM yyyy) but i am not able to get st, nd, or rd after the day in(d mmm yyyy)format like 1st 2nd 3rd 4th

    Search and thou shall find. I read a similar thread just yesterday, school task?
    you can say that you have a String postfix, which is set like this:
    String postfix = "";
    switch(dayOfMonth) {
         case 1:case 21:case31: postfix = "st"; break;
         case 2:case 22: postfix = "nd"; break;
         case 3:case 23: postfix = "rd"; break;
         default: postfix = "th";
    }

  • ORA-01810: format code appears twice ORA-02063: preceding line from PULSARL

    Hi ,
    I am running this query
    select distinct to_char(a.USAGEDATE, 'dd/mm/yyyy hh:mm'),round((a.avgifoutoctets * a.numberofrows / (a.avgdeltatime * a.numberofrows) * 8 / 1000 ), 2)as avginoctetrate from vware.vhourlyrtgusageextract a ,vware.rtginterface b where a.id = b.ID and a.id = 125555 and a.USAGEDATE >= TO_CHAR(TO_DATE('2011-05-22 11:40:47', 'yyyy-MM-dd HH:mm:ss')) and a.USAGEDATE < TO_CHAR(TO_DATE('2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss')) and a.IFDESCRIPTION = 'Serial1/0' order by 1
    I am getting this exception
    ORA-01810: format code appears twice ORA-02063: preceding line from PULSARL
    Could anybody please tell me what is the issue ??

    Hi,
    The issue is:
    SQL> select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss') from dual;
    select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mm:ss') from dual
    ERROR at line 1:
    ORA-01810: format code appears twiceYou are using MM twice. MM means two digit months. You probably mean MI for minutes for the last one:
    SQL> select TO_DATE ( '2011-05-29 11:40:47', 'yyyy-MM-dd HH:mi:ss') from dual;
    TO_DATE(
    11-05-29
    SQL>Note that you have same mistake in your to_char as well, only this does not fail.
    The ORA-02063 just tells you that the error came from a different server, PULSARL, which means you must be selecting across a database link.
    Btw, what does this mean:
             AND a.usagedate >=
                   TO_CHAR (TO_DATE ( '2011-05-22 11:40:47', 'yyyy-MM-dd HH:mm:ss'))Why are you converting a string into DATE and then back into string? - What data type is usagedate?
    Regards
    Peter

  • Date input seems to be going to US format when it should be uk

    I am access a site that requires a date input, under chrome and IE the input is fine under safari it is invalid and appears to be in US format, is there a way of changing this

    I requested that your post be moved to the iTunes form since you have an iTunes problem, not an iPod touch forum

  • Cannot Paste Duration data--format changes upon Paste!

    I'm pasting some tabular data and one column is Duration (Ex: 01:19:00) and when I paste the data in values like 01:19:00 become 1:19 AM.
    I need the actual durations so they can be computed.... how can I get Numbers to stop automatically changing these values???
    Thanks,
    Robert

    For those which don't want to pre-format a table, I wrote this script which protect the durations.
    CAUTION :
    as the developers forgot to include duration in the list of formats settable thru AppleScript, I apply the format text. You will have to change it to duration 0:00:00.
    --[SCRIPT iTunestoNumbers]
    Enregistrer le script en tant que Script : iTunestoNumbers.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Copier des données dans iTunes. Si elles contiennent des durées,
    aller au menu Scripts , choisir Numbers puis choisir “iTunestoNumbers”
    Le script les colle dans une table d'un nouveau document Numbers
    dont certaines colonnes sont définies au format texte pour préserver les dites durées.
    Il vous faudra retoucher le format en spécifiant durée, 0:00:00 dans l'Inspecteur de cellules.
    Je suis désolé mais les dévelopeurs ont oublié d'inclure durée dans les formats applicables à l’aide d’AppleScript.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: iTunestoNumbers.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Copy datas from iTunes. If they contain durations,
    go to the Scripts Menu, choose Numbers, then choose “iTunestoNumbers”
    The script will paste the datas in a Numbers new table
    whose some columns are defined as text to protect the duration entries.
    You will have to adjust the format to duration 0:00:00 thru the Inspector of Cells.
    I apologize but the develpers forgot to include duration in the list of formats settable thru AppleScript.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/03/24
    --=====
    on run
    run script doyourduty
    --my doyourduty()
    end run
    --=====
    script doyourduty
    -- on doyourduty()
    local le_fichier, en_liste, ligne_10, nb_colonnes, colonnesdedurees, c, item_c
    local format_duree, j, r, une_ligne, en_texte, myNewDoc, n_colonnes, nb_colonnes
    my activateGUIscripting()
    Extract the datas from the clipboard.
    set en_liste to paragraphs of (the clipboard as text)
    Search values containing durations to be able to apply the format duration to their columns.
    set ligne_10 to my decoupe(item 10 of en_liste, tab)
    set nb_colonnes to count of ligne_10
    set colonnesdedurees to {}
    repeat with c from 1 to nb_colonnes
    set item_c to item c of ligne_10
    if item_c contains ":" then
    set format_duree to true
    repeat with j from 1 to count of item_c
    if character j of item_c is not in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":"} then
    set format_duree to false
    exit repeat
    end if
    end repeat -- with j
    if format_duree then copy c to end of colonnesdedurees
    end if -- item_c contains…
    end repeat -- with i
    Create a new Numbers document from the Apple's Blank template.
    set myNewDoc to my makeAnIworkDoc("Numbers")
    tell application "Numbers" to tell document myNewDoc to tell sheet 1 to tell table 1
    Remove header row and header column.
    remove row 1
    remove column 1
    Insert the required columns.
    set n_colonnes to count column
    repeat nb_colonnes - n_colonnes times
    add column after last column
    end repeat
    Define the format of columns which must be set to text.
    if colonnesdedurees is not {} then
    repeat with c from 1 to count of colonnesdedurees
    set une_colonne to item c of colonnesdedurees
    set format of range ((name of cell 1 of column une_colonne) & ":" & (name of cell -1 of column une_colonne)) to text
    end repeat
    end if -- colonnesdedurees is not {}…
    Define the first cell to paste in.
    set selection range to range "A1"
    end tell -- Numbers
    Concatenate the rows with carriage return as separators. Pass the result to the clipboard.
    set the clipboard to my recolle(en_liste, return)
    with timeout of (10 * 60) seconds
    my raccourci("Numbers", "v", "cas") (* Paste and Match Style *)
    end timeout
    Select every cells except the column 1.
    tell application "Numbers" to tell document myNewDoc to tell sheet 1 to tell table 1
    set selection range to range ("A1:" & name of last cell)
    end tell -- Numbers
    As there is no shortcut, trigger the menu item itself.
    my select_menu("Numbers", 6, 17) (* Table > Resize Columns to Fit Contents *)
    if colonnesdedurees is not {} then
    set colonnesde_dureestext to my recolle(colonnesdedurees, ", ")
    tell application "Numbers"
    if not my parleAnglais() then
    if (count of colonnesdedurees) = 1 then
    display dialog "Don’t forget to set the format" & return & "of column “" & colonnesdedurees & "” to duration 0:00:00 !"
    else
    display dialog "Don’t forget to set the format" & return & "of columns “" & my recolle(colonnesdedurees, ", ") & "” to duration 0:00:00 !"
    end if -- (count of colonnesdedurees)…
    else
    if (count of colonnesdedurees) = 1 then
    display dialog "N'oubliez pas de fixer le format" & return & "de la colonne « " & colonnesdedurees & " » à durée 0:00:00 !"
    else
    display dialog "N'oubliez pas de fixer le format" & return & "des colonnes « " & my recolle(colonnesdedurees, ", ") & " » à durée 0:00:00 !"
    end if -- (count of colonnesdedurees)…
    end if -- parleAnglais{}
    end tell
    end if -- colonnesdedurees is not {}…
    -- end doyourduty
    end script
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    removes every occurences of d in text t
    on supprime(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end supprime
    --=====
    Creates a new iWork document from the Blank template and returns its name.
    example:
    set myNewDoc to my makeAnIworkDoc(theApp)
    on makeAnIworkDoc(the_app)
    local maybe, pathto_theApp, nb_doc, doc_name
    if the_app is "Pages" then
    tell application "Pages"
    set nb_doc to count of documents
    make new document with properties {template name:item 1 of templates}
    end tell
    else if the_app is "Numbers" then
    tell application "System Events" to set maybe to the_app is in title of every application process
    if not maybe then tell application the_app to activate
    tell application "System Events"
    set pathto_theApp to get application file of application process the_app
    end tell
    tell application "Numbers"
    set nb_doc to count of documents
    open ((pathto_theApp as text) & "Contents:Resources:Templates:Blank.nmbtemplate:")
    end tell
    else
    if my parleAnglais(the_app) then
    error "The application “" & the_app & "“ is not accepted !"
    else
    error "l’application « " & the_app & " » n’est pas gérée !"
    end if
    end if
    tell application the_app
    repeat until (count of documents) > nb_doc
    delay 0.1
    end repeat
    set doc_name to name of document 1
    end tell -- the_App
    return doc_name
    end makeAnIworkDoc
    --=====
    on activateGUIscripting()
    (* to be sure than GUI scripting will be active *)
    tell application "System Events"
    if not (UI elements enabled) then set (UI elements enabled) to true
    end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
    local k
    tell application a to activate
    tell application "System Events" to tell application process a
    set frontmost to true
    try
    t * 1
    if d is "" then
    key code t
    else if d is "c" then
    key code t using {command down}
    else if d is "a" then
    key code t using {option down}
    else if d is "k" then
    key code t using {control down}
    else if d is "s" then
    key code t using {shift down}
    else if d is in {"ac", "ca"} then
    key code t using {command down, option down}
    else if d is in {"as", "sa"} then
    key code t using {shift down, option down}
    else if d is in {"sc", "cs"} then
    key code t using {command down, shift down}
    else if d is in {"kc", "ck"} then
    key code t using {command down, control down}
    else if d is in {"ks", "sk"} then
    key code t using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    key code t using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    key code t using {command down, shift down, option down}
    end if
    on error
    repeat with k in t
    if d is "" then
    keystroke (k as text)
    else if d is "c" then
    keystroke (k as text) using {command down}
    else if d is "a" then
    keystroke k using {option down}
    else if d is "k" then
    keystroke (k as text) using {control down}
    else if d is "s" then
    keystroke k using {shift down}
    else if d is in {"ac", "ca"} then
    keystroke (k as text) using {command down, option down}
    else if d is in {"as", "sa"} then
    keystroke (k as text) using {shift down, option down}
    else if d is in {"sc", "cs"} then
    keystroke (k as text) using {command down, shift down}
    else if d is in {"kc", "ck"} then
    keystroke (k as text) using {command down, control down}
    else if d is in {"ks", "sk"} then
    keystroke (k as text) using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    keystroke (k as text) using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    keystroke (k as text) using {command down, shift down, option down}
    end if
    end repeat
    end try
    end tell
    end raccourci
    --=====
    my selectMenu("Numbers",6, 17) (* Table > Resize Columns to Fit Contents *)
    ==== Uses GUIscripting ====
    on selectMenu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
    tell menu bar item mt to tell menu 1 to click menu item mi
    end tell -- application theApp
    end selectMenu
    --=====
    useful to get the indexs of the triggered item
    my select_Menu("Numbers",6, 17) (* Table > Resize Columns to Fit Contents *)
    on select_menu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell (first process whose title is theApp) to tell menu bar 1
    get name of menu bar items
    01 - "Apple",
    02 - "Numbers",
    03 - "File",
    04 - "Edit",
    05 - "Insert",
    06 - "Table",
    07 - "Format",
    08 - "Arrange",
    09 - "View",
    10 - "Window",
    11 - "Share",
    12 - "Help"}
    get name of menu bar item mt
    -- {"Table"}
    tell menu bar item mt to tell menu 1
    get name of menu items
    01 - "Add Row Above",
    02 - "Add Row Below",
    03 - missing value
    04 - "Add Column Before",
    05 - "Add Column After",
    06 - missing value,
    07 - "Delete Row",
    08 - "Delete Column",
    09 - missing value,
    10 - "Header Rows",
    11 - "Header Columns",
    12 - "Freeze Header Rows",
    13 - "Freeze Header Columns",
    14 - "Footer Rows",
    15 - missing value,
    16 - "Resize Rows to Fit Content",
    17 - "Resize Columns to Fit Content",
    18 - missing value,
    19 - "Unhide All Rows",
    20 - "Unhide All Columns",
    21 - "Enable All Categories",
    22 - missing value,
    23 - "Merge Cells",
    24 - "Split into Rows"
    25 - "Split into Columns"
    26 - missing value
    27 - "Distribute Rows Evenly"
    28 - "Distribute Columns Evenly"
    29 - missing value
    30 - "Allow Border Selection"
    31 - missing value
    32 - "Show Reorganize Panel"}
    get name of menu item mi
    --{"Resize Columns to Fit Content"}
    click menu item mi
    end tell -- menu bar item…
    end tell -- System Events…
    end tell -- application theApp
    end select_menu
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) jeudi 24 mars 2011 17:08:42

  • How to convert date value(format) in Calendar(input controls)

    Hi everyone
    I am using webi 4.0
    My problem is when i select calendar date(input Controls) i am able to display time stamp along with date in input Controls(MM/dd/yyyy 12:00:00 AM)
    i want to change (MM/dd/yyyy 12:00:00 AM) to (yyyy-MM-dd ), when i select calendar date(input Controls)
    where is the calendar date(input Controls)' format setting??
    i dont want to show the time stamp in calendar date(input Controls) as my users dislike to see that timestamp .
    Thanks & regards
    'Before'
    'After'  ( i want to change 'Before' to 'After')

    Hi Park,
    Create a new variable on the Calendar Date object and edit it using FormatDate function and use that object for input control.
    =FormatDate([Date];"yyyy-MM-dd")
    Regards,
    Javed

  • ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtFetch

    Hi all,
    We are trying to create a BIP Data Model based on an Answer, but after selecting report, it hangs when I try to Apply to create a query based on Oracle BI. When I try to open the query in aswers, going to results tab I'm getting this error (OBIEE 11.1.1.6.2):
    ORA-01830: date format picture ends before converting entire input string at OCI call OCIStmtFetch
    I suppose that BIP data model is not able to create it because of this error. But this answer is working fine inside dashboards, etc. It only does not work when editing it. Query is doing something like this: "USING "- Collection Attributes"."Due Date" >= TIMESTAMPADD(SQL_TSI_DAY, -30, CAST ('01/04/2009' AS DATE))"
    Any ideas?

    Solved watching date format in generated SQL and changing default date format in presentation variables default values inside criteria according to SQL format.

  • Date Format Picture ends before converting entire input string..

    Hi all
    i am creating a report in 10g.. in which i want to convert Emp_lump_sum (number)  to character .I have created a formula column in which i have written a function in the formula column and assign that formula column to the text field in which i want the result.
    when the report run i get the following error....
    ORA-01830: date format picture ends before converting entire input string..
    i have tried with a attribute EMP_NO (Varchar2(30)), it shows the result but when i add EMP_LUMP_SUM (NUMBER) , it show the above error. on the database side i get the same error.
    Database : 11g
    OS :     Windows server 2003
    reports   : 10g
    any help will be thankful..
    Function i wrote behind the formula coloumn is..
    function CF_1Formula return CHAR is
    xy varchar2(100);
    begin
      select to_char(to_date(emp_lump_sum,'j'),'jsp') into xy from fms_111_form4_tr;
        return xy;
        --xy := f_19;
    end;

    Hello:
    Try to use a database function and call it from reports.
    Regards,

  • CRS 2008 Web Services: Date parameter format issue

    Hi All,
    I have CRS 2008 installations (Dev environment and TEST environment) on two machine (both are on the build 12.1.0.882). I have a web application that runs crystal reports deployed to these servers using web services. On the DEV Server , the report works fine when the reports input parameters are formatted to mm/dd/yyyy format.  But TEST server (which is a new installation) does not accept a date parameter value for this report in this format and returns a "could not set date parameter" error.  The report runs fine if I pass the parameter in yyyy/dd/dd format from the web-application.
    I compared the regional language settings and Business Objects registry entries on both these machines, CMC settings, and they all seem to match. Am I missing something in the configuration or environment setup that is causing this issue? Appreciate any hints on solving this issue. Thanks so much.
    Regards
    Ajith

    Hi Siva,
    may i know how to do it?
    as i did try to code in the begining by using String for my startDate and endDate. and it is able to consume, but currently if i change the startDate and endDate to Date. it is still able to consume when i change the date from "2008-01-30T10:00:50.342Z" to just "2008-01-30". but when i try to use adobe interactive form. the startDate and endDate i am using the Date/Time Field Type. and the Data Format is as Date. so it will just return "2008-01-30" only.
    the part where i have error is when i try to do a parameter mapping from the interactive form to the web service. it is unable to map as they keep prompting that cannot map a Date to a Time Stamp.
    that is why i stuck at this part.. so i try to find out how to overcome this errors now..
    Regards
    Jia Jun

  • Trasnform current date to format MM/dd/yyyy HH:mm:ss AM/PM

    Hi All,
    How do I transform current date to format MM/dd/yyyy HH:mm:ss AM/PM?
    I am able to get the format MM/dd/yyyy HH:mm:ss by using the standard date function. How do I get AM or PM to end of MM/dd/yyyy HH:mm:ss??
    Thanx
    Navin

    Hi Navin,
    How AM/PM is added? In the sample values given its in 24 hrs notation. Are u sure you want to add AM/PM to this notation? or U want to change this 24 hrs notation into 12 hrs and add AM/PM?
    For converting into 12 hrs and appending AM/PM you can use this code:
    input a:
    int hr = Integer.parseInt(a.substring(11,13));
    String appendVal = "AM";
    if(hr > 12){
       hr = hr - 12;
       appendVal = "PM";
    } else if(hr == 12){
       appendVal = "PM";
    } else if(hr == 00){
       hr = hr + 12;
    Sting finalVal = a.substring(0,11) + String.ValueOf(hr) + a.substring(13,a.length()) + appendVal;
    return finalVal;
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

  • Time and Date Stamp Format and User name

    Hi All,
    I am very new to adobe acrobat so forgive my ignorance.  I am trying to add a date and time stamp to pdf files using adobe acrobat so that when they are printed using adobe acrobat the print date will be automatically added.  First I have found the below script on the forum which is entered as a field, will this work using acrobat version 5 or version 7?  Also i believe that the date format is 10/01/2009.  How can I change this so that it will be in the 01 October 2009 and 24 hour clock format?  Finally how do I also add some descriptive text before the date and time i.e. 'print date' and 'not valid 24 hours after printing'?
    var f = this.getField("today");
    f.value = util.printd("mm/dd/yyyy
    h:MM tt", new Date());
    One last question is there a way to add a user stamp to a pdf so that when the document is printed out the user's name is printed i.e. 'printed by J Smyth'.
    Many thanks,
    John

    As noted, you need to change the formatting string to generate the date appearance as you need. You can add additional text to this string using the concatenation string operator, '+'. So you can do:
    var f = this.getField("today");
    var sDate = util.printd('dd mmm yyyy HH:MM tt", new Date())
    f.value = 'Print date: ' + sDate + ' not valid 24 hours after printing';
    All of the above information is covered in Adobe's freely down loadable Acrobat JS API and there are additional resources for JavaScript programing at the Acrobat Users Community and Planet PDF.
    Accessing the 'identity' object is more complex. First, all users will need to complete the 'Identity" information for the application's preferences, as only the login name is picked up from the OS. Then each user will need to have an application folder level JavaScirpt installed on their computer to capture this information during the application initialization of Acrobat/Reader
    // Folder level script to create an application level variables for the "identity" objects properties
    var Identity = new Array(); // array for the identity objects elements
    Identity.Corporation = identity.corporation;
    Identity.Email = identity.email;
    Identity.LoginName = identity.loginName;
    Identity.Name = identity.name;
    // or
    var Identity = new Array();
    for (i in identity)
    Identity.i = identity.i;
    You can then access the items in a PDF  by adding the array element name to the Identity array:
    // set a fied's value to the value of:
    this.getField("loginName").value = Identity.LoginName;
    this.getField("name").value = Identity.Name;
    this.getField("by").value = "By: ";
    this.getField("by").value += Identity.Name;
    You can find the necessary JavaScript folders for Acrobat using the following code in Acrobat's JavaScript debugging console:
    app.getPath("app","javascript");
    app.getPath("user","javascript");

  • Issue with Date prompt Format

    Hi Guys,
    help me..pls
    i have created one date prompt with calendar input, the date format in that prompt is like '03/15/2013' but i need to show the date format like '2013-03-15' . when i try to convert the date format, the user input calendar popup is not enabling only text box is appearing to give date input.
    can any one guide me any work around..pls

    Hello,
    Check this one : http://obiee10grevisited.blogspot.com/2012/02/customizing-obiee-calendar-display.html
    Mark if helps.
    Thanks,
    SVS

  • SQL * Loader : Load data with format MM/DD/YYYY HH:MI:SS PM

    Please advice how to load data with format MM/DD/YYYY HH:MI:SS PM into an Oracle Table using SQL * Loader.
    - What format should I give in the control file?
    - What would be the column type to create the table to load data.
    Sample data below;
    MM/DD/YYYY HH:MI:SS PM
    12/9/2012 2:40:20 PM
    11/29/2011 11:23:12 AM
    Thanks in advance
    Avinash

    Hello Srini,
    I had tried with the creation date as DATE datatype but i had got an error as
    ORA-01830: date format picture ends before converting entire input stringI am running the SQL*LOADER from Oracle R12 EBS front-end.
    the contents of my control file is
    LOAD DATA
    INFILE "$_FileName"
    REPLACE
    INTO TABLE po_recp_int_lines_stg
    WHEN (01) = 'L'
    FIELDS TERMINATED BY "|"
    OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    INDICATOR                POSITION(1) CHAR,
    TRANSACTION_MODE          "TRIM(:TRANSACTION_MODE)",
    RECEIPT_NUMBER               "TRIM(:RECEIPT_NUMBER)",
    INTERFACE_SOURCE          "TRIM(:INTERFACE_SOURCE)",
    RECEIPT_DATE               "TO_CHAR(TO_DATE(:RECEIPT_DATE,'MM/DD/YYYY'),'DD-MON-YYYY')",
    QUANTITY               "TRIM(:QUANTITY)",
    PO_NUMBER               "TRIM(:PO_NUMBER)",
    PO_LINE_NUMBER               "TRIM(:PO_LINE_NUMBER)",
    CREATION_DATE               "TO_CHAR(TO_DATE(:CREATION_DATE,'MM/DD/YYYY HH:MI:SS AM'),'DD-MON-YYYY HH:MI:SS AM')",
    ERROR_MESSAGE                   "TRIM(:ERROR_MESSAGE)",
    PROCESS_FLAG                    CONSTANT 'N',
    CREATED_BY                      "fnd_global.user_id",
    LAST_UPDATE_DATE                SYSDATE,
    LAST_UPDATED_BY                 "fnd_global.user_id"
    {code}
    My data file goes like
    {code}
    H|CREATE|123|ABC|12/10/2012||||
    L|CREATE|123|ABC|12/10/2012|100|PO12345|1|12/9/2012  2:40:20 PM
    L|CORRECT|123|ABC|12/10/2012|150|PO12346|2|11/29/2011 11:23:12 AM{code}
    Below is the desc of the table
    {code}
    INDICATOR             VARCHAR2 (1 Byte)                         
    TRANSACTION_MODE        VARCHAR2 (10 Byte)                         
    RECEIPT_NUMBER             NUMBER                         
    INTERFACE_SOURCE        VARCHAR2 (20 Byte)                         
    RECEIPT_DATE             DATE                    
    QUANTITY             NUMBER                    
    PO_NUMBER             VARCHAR2 (15 Byte)                         
    PO_LINE_NUMBER             NUMBER                         
    CREATION_DATE             TIMESTAMP(0)                         
    ERROR_MESSAGE             VARCHAR2 (4000 Byte)                         
    PROCESS_FLAG             VARCHAR2 (5 Byte)                         
    CREATED_BY             NUMBER               
    LAST_UPDATE_DATE        DATE               
    LAST_UPDATED_BY             NUMBER     {code}
    Thanks,
    Avinash                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • How do I read a pulsed input on an SCB-68 counter channel?

    Hello all, I have been searching through the DAQ help and this board for a few hours now and I cannot find an answer that addresses what should be a simple problem. Let's start with hardware and software: I have a 6062E PCMCIA DAQmx card connected to

  • Can I physically install my 0.5 TB USB 2 external drive in my Mac Pro?

    Hi guys. I bought a .5 TB external USB hard drive a while back when I used to produce/sequence my music on a PC. Since switching I've re-formatted the drive to HFS, re-installed my samples etc, and now use it with my Mac Pro. My question is: Could I

  • Restrict use of payment terms

    Is there a way where I could restrict use/view of payment term in the customer master data entry (FD01, XD01)?  I  have created an authorization object for ZTERM (SU20, SU21) and assigned this object (SU24) to tcode FD01, XD01.  The authorization ass

  • Is there a problem with the OS X Update 10.9.3

    I have been trying to update this software for several days, it will not update.  Can someone help me. Marie

  • My Boot Camp won't work properly on my Macmini

    My macmini has bootcamp, but bootcamp says I need 10 GBs of free space, I have20 GBs of free space and it still win't reconize it!