Date format in Query

I checked in SQL to see that the createdate and getdate were the same format, and they are -- but obviously SAP B1 presents it in a regular format.  How do I write the query so that the two formats are the same?
SELECT T0.[callID], T0.[subject], T0.[customer], T0.[custmrName] FROM OSCL T0 WHERE T0.[createDate] = getdate()

Hi Carrie,
Try this, you will be get the exact result.
SELECT T0.callID, T0.subject, T0.customer, T0.custmrName
FROM OSCL T0
WHERE
(SELECT CONVERT(VARCHAR(8), T0.CreateDate, 3)) = (SELECT CONVERT(VARCHAR(8), GETDATE(), 3))
OR
Try to use parameter.
SELECT T0.callID, T0.subject, T0.customer, T0.custmrName FROM OSCL T0 WHERE T0.createDate = '[%0]'
Regards,
Madhan.
Edited by: Madhan Babu C on Jan 11, 2010 12:37 PM

Similar Messages

  • Date format in Query Result Window

    In recent versions on OSD (trying with V3.2.20.09 Build MAIN-09.87) I've been unable to change the date format for results shown in the query results window via the NLS settings in Preferences, it's the same for other users on v3 in my area. Can anyone advice on whether anything can be done to resolve this issue or is there a bug in recent additions of OSD
    Frustrating having a result show as 01-DEC-12 and I don't know whether it's 01-DEC-2012 or our default date of 01-DEC-4712 without having to hard code a to_char in my sql which I don't want to be doing all the time to analyse my results
    I have an old version 1.5.4 Build MAIN-5940 and changing the NLS settings in preferences refrects correctly in the query results window
    Any advice appreciated, Thanks

    Thanks, looks like it's permission, tried on a different database supposed to be the same and it works when I update the preferences or run the alter session statement. Call to my admins to get on the case
    Ta
    for anyone else having simular issues, help are the statements I've tried to confirm it's permissions
    alter session set NLS_DATE_FORMAT = 'DD-MON-RR HH24:MI:SS'; -- Original
    alter session set NLS_DATE_FORMAT = 'DD-MON-RRRR HH24:MI:SS';
    commit;
    SELECT *
    FROM nls_session_parameters
    Edited by: lakeuk on 14-Nov-2012 06:37

  • How to change date format in query

    Hi all!
    there is Date field in query (ref to 0Date) and it is in "01.2010" format. Anybody knows how to switch to "Jan 2010" format?

    HI,
    You can dispay using the excel properties. Once after the workbook run, select the column you want to change the format and cange to the format required. Save the workbook.
    From next run the date field will be displayed as the format set in workbook.
    Hope this helps,
    regards,
    anil

  • Change date format in query

    Hi gurus
    I need to execute a query with date in International format (AAAAMMDD). In SU01 this format doesn't exist. The solution of change PC parameters before execution is not simple because queries are executed in background and broadcasted.
    Is there a way to change the format of the date in workbook?
    Thanks

    Hi,
    The Screen display for the Bex Analyzer is closely linked to the default date settings on the PC. These settings can be changed by the user to match the settings you desire. In Windows XP this setting can be changed by selecting:Start ->Settings -> Control Panel ->Regional & Language Options In this window select the customize button which will open a new window In the new window select the date tab, Go to the short date format field There will not be a standard with the option you desire you will need to enter the format manually. Select the apply button and then the Okay button. This will change your default date format in Bex and in excel spreadsheets.
    Regards
    CSM Reddy

  • Changing Date Format in query panel default calender

    Hi All,
    when I drag the date into the Query Filter Panel in Webi and use the between operator (or any operator) the format of the date shows up as DD/MM/YYYY as default . But we want the format should show up as DD/MM/YYYY HH24:MM:SS
    As far as we know, there is no preference setting available in WebI. Could you please guide us how can we change the format?
    thx

    Hi,
    Are you using a date object or a string object for date.
    If you are using a date object then you would have the option of calendar selection when using between where you would be able to see your desired format.
    I think if this does not resolve ur issue then either by changing regional settings or by changing the User setting (i.e. if you are using a single signon for ur Database (maybe SAP system) and ur BO WebI reports then the user id settings would directly apply here and you should be able to acheive mm/dd/yyyy hh:mm:ss format.)
    I hope this helps.
    Regards,
    Kartik

  • Date format in query results

    HI, newbie to sql and Oracle. Quick question, my associate and I view date and timestamps in the same column in our db tables. We can run a query requesting date and time returned in sqlplus and it displays the date then the time. However, running the same query in sql developer worksheet window the results return only the date. We believe this is a formatting issue in sql developer. We check Tools > Prefs > Database > NLS Parameters under Timestamp format and it shows "DD-MON-RR HH.MI.SSXFF AM". We are not sure this is right but we are not sure we are looking in the right area as well. Any assistance with this is greatly appreciated.
    thx
    tc

    Never mind. Found it. Had to copy from that field in to the one above it to get the view needed.

  • Date format in Query Extract - Urgent

    Hi,
      I'm using Query-Extract (RSCRM_BAPI) to extract query data and store it in separate location.
    While extracting the data into .csv ot .txt file, date will be displayed as yyyymm (200807). As per the requirement we should display the date in the format mmm-yyyy (Jul-2008).
    Please help me. its very urgent.
    Thanks,
    Varun

    Hi ,
    This issue can be solved by writing a routine in update rules pls take the help of abap experts to solva this
    this is not a big issue for them
    Hope i have guided u properly
    Pls assign me points my boss ??
    Regards ,
    Subash Balakrishnan

  • Date format mask in Enter-Query mode

    Hi,
    I'm developing a Form which is able to query the masterblock from a detail-item.
    The queryable detail-item is a date field and has a datatype: DATETIME. When a new record is entered the values in the date field are stored in the database like "18-10-2002 15:04:02"
    When the form is in enter_query mode the user must be able to enter 18-10-2002 (DD-MM-YYYY format mask, so without time mask). When execute the query with this date format the query is not able to find data.
    I used a Key-Execute-Query on the detailblock like this:
    SELECT 1.COLUMN
    , 2.COLUMN
    INTO :1.COLUMN
    , :2.COLUMN
    FROM TABLE.1
    , TABLE.2
    WHERE 1.COLUMN = 2.COLUMN
    AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    Can anyone please help me?
    Regards,
    Ronny.

    Hi Ronny,
    I'm not sure to have got exactly your issue (especially why you have to use that select in master-detail query), but I suggest you to substitute
    ...AND TO_CHAR(1.COLUMN,'dd-mm-yyyy') = to_date(:avg.datum,'dd-mm-yyyy');
    with
    ...TRUNC(1.COLUMN) = TO_DATE(:avg.datum,'dd-mm-yyyy');
    To be fair, I would use it in the where clause, even if you set it dinamically.
    Let us know,
    Marco

  • How to convert milliseconds to date format in sql query

    Hi All,
    The following code is in java.     
    String yourmilliseconds = "1316673707162";**
    Date resultdate = new Date(Long.parseLong(yourmilliseconds));
    could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)

    Hello,
    http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
    Regards

  • Date formats in BI Query designer

    Hi gurus
    We have enhanced our cube 0sd_co3 where we have taken a number of dates such as Railway Receipt date, Actual Goods Issue date, LFdat, thses are only few examples. Now our reporting scenerio demands reporting based on thses dates as given in our time dimensions such as
    YYYYMM        Qty
    but not based on the date mapped in the time dimension in the cube. but based on these dates
    in oracle we have the to_char function through which we change the format of date while writing sql query
    so if there is any option of changing date format in query without changing the modelling
    Pl suggest
    Thanks
    Shivani

    Hi,
    You can create new characteristic of char number 6 . Include it in the data target. Populate it via a update rule ( Routine).
    Use input as standard date (Railway Receipt date) and then pass the value to the new char in the required format (YYYYMM). Follow same thing for other dates also.
    Let me know if you have doubt.
    Regards,
    Viren

  • Another date formating issue

    I want the date to appear in Mmm-dd format - but I keep
    getting the full ODBC date format
    my query:
    <cfquery name="monthlyChart" datasource="2onboard">
    SELECT distance, time, walkDate
    FROM bockWalk
    WHERE month(walkDate)=#month(Now())# AND
    year(walkDate)=#year(Now())#
    </cfquery>
    my cfchart:
    <cfchart format="swf"
    style="/xml/dailyDistanceGraphs.xml"
    chartheight="175"
    chartwidth="575"
    showlegend="no"
    showborder="yes"
    show3d="no"
    foregroundcolor="000000"
    scalefrom="0"
    yaxistitle="Mileage">
    <cfchartseries type="bar"
    query="monthlyChart"
    valuecolumn="distance"
    itemcolumn="walkDate"
    seriescolor="ff0000">
    </cfchartseries>
    </cfchart>
    I've even tried formating it with an XML file
    Part of XML file
    <xAxis>
    <labelStyle isMultiline="false" orientation="vertical"
    />
    <labelFormat style="ShortDate" pattern="Mmm-dd" />
    </xAxis>

    quote:
    Originally posted by:
    jkgiven
    MikerRoo...
    Your solution stacks all my entries into one column instead
    of one for each date, why/how fix?
    Why didn't the <labelFormat style="ShortDate:
    pattern="MMM-dd" /> line in my xml work?
    Can you explain, or point me to a source, of how your lines
    work? - I really need to learn XML but it just doesn't seem to
    quite make sense to me.
    Your entries are all in one column because either:
    (1) You did not set the parseFormat pattern to match what was
    being returned by the database
    or
    (2) The chart granularity is set for monthly data and the
    data does not span enough time. Change the dateTimeStyle to:
    <dateTimeStyle majorUnit="Day" minorUnit="Day"/>
    <labelFormat style="ShortDate" pattern="Mmm-dd" /> did
    not work because (1) you needed to switch the axis mode to datetime
    and (2) the chart engine is very stupid and needs to be told
    exactly how to parse the values returned in the query. That is the
    purpose of the <parseFormat> tag.
    Finally, you do not need to learn XML per se.
    The XML styles are covered, a little, in the docs starting at
    <cfchart>
    There is a handy tool, webcharts designer, that you can use
    to generate xml styles at:
    c:\CFusionMX7\charting\webcharts.bat
    The Webcharts user guide covers the available styles in more
    detail. You can download that here:
    http://www.webcharts3d.com/website/WebCharts50/download/index.jsp

  • Date format in BI query

    Hi,
    We need to display a single date format independent of date format of SAP User settings. For ex: as below.
    In a current query the  date, depending on the user's configuration could appear as:
    dd.mm.yyyy (English format)         or        yyyy-mm-dd (Swedish format)        or        mm.dd.yyyy (American format)
    I need to change some of the queries date format as below.
    a) Change all dates in query outputs and parameters to the format YYYYMMDD
    b) Change all months in query outputs and parameters to the format YYYYMM
    c) Change all financial periods in query outputs and parameters to the format YYYYPPP
    Thanks,
    Jitu

    Hi
    I think u have to use the ABAP code at the query level.
    First take the date in one variable zdate_var  and then if u want the below , then
    data : zdate_var_year type d,
               zdate_var_mm type d,
              zdate_var_dd type d.
    zdate_var_year = zdate_var(4).
    zdate_var_mm = zdate + 4(2).
    zdate_var_dd = zdate + 6(2).
    YYYYMM = zdate_var_year , zdate_var_mm.
    LIke this u can have ur o/p as per ur wish,
    Hope u got it ,
    Thanx & Regards,
    RaviChandra

  • Date format conversion in BEX query level

    Hi ,
          We had a date field in the numeric format like 735.020 in the cube level, but when we execute the query the values for thsi date field is changed in to date format like 31.05.2013.
    we are not having any conversion routines and the date fields are used directly in the query .

    Hi,
    Try the below class file or may be create a method in your controller. It will resolve your problem.
    package com.XXX.DateFormatForSAP;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    public class FormatSAPDate {
    public static String changeDateFormat(Date sapDate) {
    String formattedDate = null;
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    formattedDate = dateFormat.format(sapDate);
    return formattedDate;
    Try this code and let me know.
    Regards
    Mukesh

  • Wrong query results: due to date format?

    hello,
    I have oracle 11 and when I execute this query:
    select MYDATE from mytable order by MYDATE DESC;
    it get me a bad order:
    MYDATE
    25-MAR-09
    13-MAR-09
    10-MAR-10
    10-MAR-10
    31-JAN-10
    29-JAN-10
    28-JAN-10
    08-DEC-09
    07-DEC-09
    06-DEC-09
    05-DEC-09
    is it may due to a wrong date format?
    where have I to look out? init.ora?

    But, there is no problem at my end (Using Oracle 10.2.0.1 on win xp):
    SQL> create table t(mydate date);
    Table created.
    SQL> insert into t values(to_date('25-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('13-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('31-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('07-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('05-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('06-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('08-DEC-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('10-MAR-09','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('29-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('10-MAR-10','DD-MON-YY'));
    1 row created.
    SQL> insert into t values(to_date('28-JAN-10','DD-MON-YY'));
    1 row created.
    SQL> select * from t;
    MYDATE
    25-MAR-09
    13-MAR-09
    31-JAN-10
    07-DEC-09
    05-DEC-09
    06-DEC-09
    08-DEC-09
    10-MAR-09
    29-JAN-10
    10-MAR-10
    28-JAN-10
    11 rows selected.
    SQL> SELECT MYDATE FROM T ORDER BY MYDATE DESC;
    MYDATE
    10-MAR-10
    31-JAN-10
    29-JAN-10
    28-JAN-10
    08-DEC-09
    07-DEC-09
    06-DEC-09
    05-DEC-09
    25-MAR-09
    13-MAR-09
    10-MAR-09
    11 rows selected.
    SQL> SHOW PARAMETER NLS_DATE;
    NAME                                 TYPE        VALUE
    nls_date_format                      string
    nls_date_language                    stringCan you show us the output of
    show parameter nls_date;
    Regards
    Girish Sharma

  • Formatting Date in af:query component in ADF

    Hi,
    i am using <af:query>  ADF Component.It is binded to a VO through which attributes are getting displayed in the search.
    i have a date component in the vo and want the date format to be displayed as '06-AUG-2013'. how can i achieve this?

    You can set a date format in the VO. Open the VO, go to "Attributes" and double click the attribute. In the Popup go to "Control Hints". Choose "Simple Date" in the field "Format Type". Then enter the format you want to be applied into the field "Format" (e.g. dd-MMM-yyyy).
    Regards,
    Linda

Maybe you are looking for

  • How do I transfer my music from my external hard drive with the extension .itl?

    I transferred my music from my old computer to an external hard drive.  Now trying to get my music to load into my new computer via external hard drive but I do not think it will due to the extension of .itl.  what shall I do?

  • Dreamweaver Flash Media Skins

    Is there a way to select external skins for Flash media in Dreamweaver? In Dreamweaver 8, I only have the selection of 3 different kind of skins...all internal to the video. Does anyone know a solution to this? Thank you.

  • No Edit To Tape?

    I know we all love digital file based cameras like RED and such, but I can't find any mention in the documentation about support for either capture or play out to VTRs.  I work in both short and long format and we regularly have to create dump reels

  • Error in DMS while accessing from portal

    Hi Experts, Iam getting the below error in portal while accessing the dms repository. the repository was fine status is in green color but still getting the error while iam viewing it from content administration > kmcontent> my repository name what s

  • Login in to oracle express 11g

    I'm having issues trying to log into oracle express 11g. It asks for user id and password and nothing I try works. The following statement is below the log in statement " Login as a database user which has been granted the DBA database role (for exam