Date format in script format

hi,
how to change the date format in script form.
thanks.

try like this
/: SET DATE MASK = 'Foster City, MM.DD.YY'
&DATE& -> Foster City, 03.01.97
&DATE(Z)& -> Foster City, 3.1.97
/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997
regards
Prabhu

Similar Messages

  • SAP Script - How to write data in a table format.

    Hi All,
    In my requirement, I need to show item data in a table format ( In a box, with horizental & veritcal lines.
    can somebody pl give me a small code to do this.
    Regards,
    Hardik

    Hi
    SCRIPT BOXES
    POSITION WINDOW
    SIZE WIDTH '160' MM HEIGHT '140' MM
    BOX FRAME 10 TW
    Box
    BOX HEIGHT '11' MM WIDTH '160' MM FRAME 10 TW INTENSITY 35
    linessssssss
    BOX XPOS '20' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '45' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '80' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    BOX XPOS '120' MM WIDTH 0 TW HEIGHT '140' MM FRAME 10 TW
    Boxes, Lines, Shading: BOX, POSITION, SIZE
    Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
    The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
    Syntax:
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX Command
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
    XPOS, YPOS
    Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    WIDTH
    Width of the box. Default: WIDTH value of the SIZE command.
    HEIGHT
    Height of the box. Default: HEIGHT value of the SIZE command.
    FRAME
    Thickness of frame.
    Default: 0 (no frame).
    INTENSITY
    Grayscale of box contents as %.
    Default: 100 (full black)
    Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    TW (twip)
    PT (point)
    IN (inch)
    MM (millimeter)
    CM (centimeter)
    LN (line)
    CH (character).
    The following conversion factors apply:
    1 TW = 1/20 PT
    1 PT = 1/72 IN
    1 IN = 2.54 CM
    1 CM = 10 MM
    1 CH = height of a character relative to the CPI specification in the form header
    1 LN = height of a line relative to the LPI specification in the form header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shading having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION Command
    Syntax
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    XORIGIN, YORIGIN
    Origin of the coordinate system.
    WINDOW
    Sets the values for the left and upper edges to match those of the current window (default setting).
    PAGE
    Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE Command
    Syntax
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    WIDTH, HEIGHT
    Dimensions of the rectangle or line.
    WINDOW
    Sets the values for the width and height to the values of the current window (default setting).
    PAGE
    Sets the values for the width and height to the values of the current output page.
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
    <REMOVED BY MODERATOR>
    Regards
    Anji
    Edited by: Alvaro Tejada Galindo on Jul 8, 2008 10:59 AM

  • Date format in Scripts

    Dear All,
    I want to change date format in script text elements. Now the date format is MMDDYYYY. Now I want change it into DDMMYYYY. How I can change that.
    Thanks and regards,
    Krish....

    WRITE ONE Z PROGRAM .
    EX. ZTEST
    write the code below.
    PROGRAM ZTEST.
    form GET_NEWDATE tables in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    DATA : LV_NEWDATE TYPE D.
    DATA : LV_OLDDATE LIKE OLDDATE,
    data : gv_dd(2) type c,
    gv_mm(2) type c,
    gv_yy(4) type c.
    data : date(8) type c.
    gv_dd = LV_OLDDATE(+22).
    gv_mm = LV_OLDDATE(2).
    gv_yy = LV_DOC_DATE+4(4).
    CONCATENATE gv_dd gv_mm gv_yy INTO date.
    LV_NEWDATE = DATE.
    read table OUT_tab index 1.
    MOVE LV_NEWDATE TO OUT_TAB-VALUE.
    CONDENSE OUT_TAB-VALUE.
    MODIFY OUT_TAB INDEX 1.
    ENDFORM.
    write the code below in ur sapscript,
    /:DEFINE &LV_NEWDATE&.
    /:PERFORM GET_NEWDATE IN PROGRAM TEST
    /:USING &LV_OLD_DATE&
    /:CHANGING &LV_NEWDATE&.
    PRINT &LV_NEWDATE&
    ENDPERFORM.

  • Date formating in scripts

    hi experts,
    I want to print date in dd.mm.yyyy format in script.
    I have used SET DATE MASK command in script...
    But i am getting ddmmyyy format without any seperators.
    plz tell me what can be done.
    regards.
    sm

    instead of date print date1.
    write the above said code in driver program and write this variable in script.
    regards.
    santhosh reddy

  • HELP! date pass to script not display in date format

    hi all,
    i want to include final approver date into Puchase Order, and i call up a form, getting the date from CDHDR. however, when i return the date back to the script, the date display in PO are out of date format.
    original : 16.07.2007
    but it shows as : 20070716
    how am i going to change it to the actual proper format in script?
    very thanks for the help first.

    hi,
    but i have other date ( such as create date) which are showing correctly. the create date gets directly from table.
    i tried to use the SET DATE, but there is no charge on it. my actual code is as below:
    /:           PERFORM GET_TEST IN PROGRAM Z_TESTING6
    /:           USING &EKKO-EBELN&
    /:           CHANGING &UDATE&
    /:           ENDPERFORM
    PO            Release Date,,&UDATE&
    can only one help me. thanks

  • Excel date to Numbers text format troubles

    I've been sent an Excel .xls document which I'm opening in Numbers '09 (2.1).
    The spreadsheet has a date column which I need to be in text format as dd/mm/yyyy. I expected the original Excel document to have the dates already in text format but Numbers says the fields are 'Custom' and shows the dates in US format: 11/04/2011, even although my Mac is set to UK format. No matter, I can set the cells to text format, however that results in the date being shown as 04/11/00002011.
    Where did those extra zeros in the year come from!?
    How can I reformat the dates to the dd/mm/yyyy format as text?
    I've tried a couple of formula to create a new column
    =Year(A1)
    for example and I think I could recreate the date  like that, but the cell must be text format.
    DG

    Here is the script required to peek dates from Numbers then poke them in Numbers.
    --{code}
    Apply this script to a Numbers table containing :
    B2 : 1943/12/31 23:59
    B3 : 1789/07/14
    B4 : 2010/01/01 00:12
    B5 : = NOW()
    set myTimeZone to (do shell script ("/usr/bin/perl -le 'print( readlink(\"/etc/localtime\") =~m{zoneinfo/(.*)} )' ")) -- Perl code by Mark J. Reed.
    tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
              repeat with r from 2 to 5
                        set thenumbersdate to value of cell r of column 2
                        set value of cell r of column 3 to thenumbersdate as text
                        set thenumbersdate to my TZtoGMT(thenumbersdate, myTimeZone)
                        tell cell r of column 4
                                  set format to text
                                  set value to thenumbersdate as text
                        end tell
                        tell cell r of column 5
                                  set format to text
                                  set value to short date string of thenumbersdate
                        end tell
              end repeat
    end tell
    --=====
    set myTimeZone to (do shell script ("/usr/bin/perl -le 'print( readlink(\"/etc/localtime\") =~m{zoneinfo/(.*)} )' ")) -- Perl code by Mark J. Reed.
    set thenumbersdate to my TZtoGMT(thenumbersdate, myTimeZone)
    Handlers by Nigel GARVEY
    http://macscripter.net/viewtopic.php?id=36449
    (* Convert an ISO-format date string to an AppleScript date. *)
    on isotToDate(isot)
              set n to (text 1 thru 8 of isot) as integer
              set ASDate to (current date)
              tell ASDate to set {day, year, its month, day} to {1, n div 10000, n mod 10000 div 100, n mod 100}
              if ((count isot) > 8) then
                        set n to (text 10 thru 15 of isot) as integer
                        set ASDate's time to n div 10000 * hours + n mod 10000 div 100 * minutes + n mod 100
              end if
              return ASDate
    end isotToDate
    --=====
    (* Transpose an AppleScript date/time from the given time zone to GMT. *)
    on TZtoGMT(TZDate, TZ)
      -- The difference between TZDate when it's local and the GMT date we want is usually
      -- the same as the difference between the local date when TZDate is GMT and TZDate itself …
              set GMTDate to TZDate - (GMTtoTZ(TZDate, TZ) - TZDate)
      -- … but not around the time the clocks go forward. If the GMT obtained doesn't reciprocate to TZDate,
      -- shift to a nearby local date where the above DOES work, get a new GMT, unshift it by the same amount.
              set testDate to GMTtoTZ(GMTDate, TZ)
              if (testDate is not TZDate) then
                        if (GMTDate > testDate) then -- "Clocks forward" is towards GMT.
                                  set shift to GMTDate - testDate
                        else -- "Clocks forward" is away from GMT.
                                  set shift to -days
                        end if
                        set nearbyDate to TZDate + shift
                        set GMTDate to nearbyDate - (GMTtoTZ(nearbyDate, TZ) - nearbyDate) - shift
              end if
              return GMTDate
    end TZtoGMT
    --=====
    (* Transpose an AppleScript date/time from GMT to the given time zone. *)
    on GMTtoTZ(GMTDate, TZ)
      -- Subtract date "Thursday 1 January 1970 00:00:00" from the GMT date. Result in seconds, as text.
              copy GMTDate to date19700101
              tell date19700101 to set {year, its month, day, time} to {1970, 1, 1, 0}
              set eraTime to (GMTDate - date19700101)
              if (eraTime > 99999999) then
                        set eraTime to (eraTime div 100000000 as text) & text 2 thru 9 of (100000000 + eraTime mod 100000000 as integer as text)
              else if (eraTime < -99999999) then
                        set eraTime to (eraTime div 100000000 as text) & text 3 thru 10 of (-100000000 + eraTime mod 100000000 as integer as text)
              else
                        set eraTime to eraTime as text
              end if
              return isotToDate(do shell script ("TZ='" & TZ & "' /bin/date -r " & eraTime & " +%Y%m%dT%H%M%S"))
    end GMTtoTZ
    --=====
    --{code}
    Yvan KOENIG (VALLAURIS, France) samedi 5 novembre 2011 14:14:26
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Storing Sapscript data in Tab delimited format

    Hi All,
    Can anyone please advise me how can I store my Sapcript data in Application server in a Tab delimited format?
    Is there any FM for that or should I use Open dataset?
    Please send sample code, if anyone have.
    Moreover, please let me know where to write the code in application form of print wrokbench?
    Thanks & Regards,
    Anshumita.

    Hi Baski ,
    1.First u have to get the OTF data of the Scripts ,after calling Close_form.
    2.Write that data into Application Server by using Commaands <b>Open data set</b>.
    Regards
    Prabhu

  • Could I define the DAT-Format as default format in Diadem 9.x or 10.x ?

    Hello,
    could I define the old DAT-format as default format in the different dialog (navigator etc..)  in the new Version of diadem  (9 or 10) ?
    Thanks

    Hello,
    unfortunately this is not possible.
    Since DIAdem 9 we also have the wish to configure it, but ever got the answer that the new TDM-fomat is the new standard.
    For your own you could write a little one-row-script like
    Call FileNameGet("NAVIGATOR", "FileRead", DataDrvUser&"*.dat", "DD8x")
    and connect it with a SCRIPT - shortcut to start it with e.g. the SHIFT+F1 - keys...
    With regards
    Sven

  • Active responsibilities program with post script format not working

    Hi All,
    Env.   ERP
    11.5.10.2, DB: 9.2  OS: Solaris 9
    Active responsilties report with format post script is completing with normal but when I view output for the request it doesn't contain any data its blank.....
    any suggestion will be appreciated
    Regards

    Hi Reshma,
    This is because the field v_tax1 is of currency type, which has a length of 16 (13,2). This is getting displayed right-aligned by default, and the leading spaces are always appearing.
    You will have to deduct the no. of spaces that gets printed by writing v_tax1(8.2) or v_tax1(9.2) etc. First you should know what can be the maximum possible figure for this.
    Another way-out is to convert this to a character variable. delete leading spaces from the character variable (functions: shift left deleting leading space, or condense) and then printing the variable right-aligned / left-aligned.

  • Restored our SSRS 2008 R2 from one server to another; Dates are in UK format and not US

    We have restored our SSRS 2008 R2 from one server to another. The original server was in US locale/culture. The new server was in UK locale/culture, when the restore happened. However it should have been in US locale/culture. We have made this change and
    new reports work OK.
    However existing reports (i.e. saved by a user) are still trying to use the US dates in a UK format and as a result throwing a date cant be below 1753 error.
    Has anyone seen this issue before or have any idea what we need to do to fix it?
    Thanks
    Kimberlad

     Hi Kimberlad
    Have you checked any changes in the Collation? 
    Please verify Reporting Server Databases and Server Collation is there any mismatch with your Source Server.
    and also please post complete Error message..
    Nag Pal MCTS/MCITP (SQL Server 2005/2008) :: Please Mark Answer/vote if it is helpful ::

  • External table: How to load data from a fixed format UTF8 external file

    Hi Experts,
    I am trying to read data from a fixed format UTF8 external file in to a external table. The file has non-ascii characters, and the presence of the non-ascii characters causes the data to be positioned incorrectly in the external table.
    The following is the content's of the file:
    20100423094529000000I1 ABÄCDE 1 000004
    20100423094529000000I2 OMS Crew 2 2 000004
    20100423094529000000I3 OMS Crew 3 3 000004
    20100423094529000000I4 OMS Crew 4 4 000004
    20100423094529000000I5 OMS Crew 5 5 000004
    20100423094529000000I6 OMS Crew 6 6 000004
    20100423094529000000I7 Mobile Crew 7 7 000004
    20100423094529000000I8 Mobile Crew 8 8 000004
    The structure of the data is as follows:
    Name Type Start End Length
    UPDATE_DTTM CHAR 1 20 20
    CHANGE_TYPE_CD CHAR 21 21 1
    CREW_CD CHAR 22 37 16
    CREW_DESCR CHAR 38 97 60
    CREW_ID CHAR 98 113 16
    UDF1_CD CHAR 114 143 30
    UDF1_DESCR CHAR 144 203 60
    UDF2_CD CHAR 204 233 30
    DATA_SOURCE_IND CHAR 294 299 6
    UDF2_DESCR CHAR 234 293 60
    I create the external table as follows:
    CREATE TABLE "D_CREW_EXT"
    "UPDATE_DTTM" CHAR(20 BYTE),
    "CHANGE_TYPE_CD" CHAR(1 BYTE),
    "CREW_CD" CHAR(16 BYTE),
    "CREW_DESCR" CHAR(60 BYTE),
    "CREW_ID" CHAR(16 BYTE),
    "UDF1_CD" CHAR(30 BYTE),
    "UDF1_DESCR" CHAR(60 BYTE),
    "UDF2_CD" CHAR(30 BYTE),
    "DATA_SOURCE_IND" CHAR(6 BYTE),
    "UDF2_DESCR" CHAR(60 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "TMP"
    ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE
    CHARACTERSET UTF8
    STRING SIZES ARE IN BYTES
    NOBADFILE NODISCARDFILE NOLOGFILE FIELDS NOTRIM
    ( "UPDATE_DTTM" POSITION (1:20) CHAR(20),
    "CHANGE_TYPE_CD" POSITION (21:21) CHAR(1),
    "CREW_CD" POSITION (22:37) CHAR(16),
    "CREW_DESCR" POSITION (38:97) CHAR(60),
    "CREW_ID" POSITION (98:113) CHAR(16),
    "UDF1_CD" POSITION (114:143) CHAR(30),
    "UDF1_DESCR" POSITION (144:203) CHAR(60),
    "UDF2_CD" POSITION (204:233) CHAR(30),
    "DATA_SOURCE_IND" POSITION (294:299) CHAR(6),
    "UDF2_DESCR" POSITION (234:293) CHAR(60) )
    ) LOCATION ( 'D_CREW_EXT.DAT' )
    REJECT LIMIT UNLIMITED;
    Check the result in database:
    select * from D_CREW_EXT;
    I found the first row is incorrect. For each non-ascii character,the fields to the right of the non-ascii character are off by 1 character,meaning that the data is moved 1 character to the right.
    Then I tried to use the option STRING SIZES ARE IN CHARACTERS instead of STRING SIZES ARE IN BYTES, it doesn't work either.
    The database version is 11.1.0.6.
    Edited by: yuan on May 21, 2010 2:43 AM

    Hi,
    I changed the BYTE in the create table part to CHAR, it still doesn't work. The result is the same. I think the problem is in ACCESS PARAMETERS.
    Any other suggestion?

  • How to get the Date in a particular format?

    Hi,
    How to get the Date in the below format? I will be passing the year in my method..
    2/10/2003 9:46:52 PM
    D/M/YYYY H:M:S A
    public Date getDate (String year) {
    Here i want to get the Date in this format
    2/10/<Passed Year> 9:46:52 PM
    Thanks

    This is my code
    public static Date getCalendar(Calendar calendar,int getYear) {
    String      formatted_date="";
         int year = getYear;
         int month = calendar.get(Calendar.MONTH+1);
         int day = calendar.get(Calendar.DATE);
         int hour = calendar.get(Calendar.HOUR);
         int min = calendar.get(Calendar.MINUTE);
         int sec = calendar.get(Calendar.SECOND);
         int am_pm =calendar.get(Calendar.AM_PM);
         formatted_date = month+"/"+day+"/"+year+" "+hour+":"+min+":"+sec+" PM";
         System.out.println("formatted_date is "+formatted_date);     
         o/p : formatted_date is 1/4/2006 1:44:21 PM
         SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    //     DateFormat dateFormat =DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
         Date passdate = new Date();
         try {
              passdate = dateFormat.parse(formatted_date);
         } catch (ParseException e) {
              System.out.println("Invalid Date Parser Exception "+e.getLocalizedMessage()+"DateFormat is "+dateFormat);
              System.out.println("The Date inside the function is "+passdate+"and the year passed is "+year);
    o/p : The Date inside the function is Sat Apr 01 00:00:00 IST 2006and the year passed is 2006
         return passdate;
    Expected O/P is 3/1/2006 1:44:12 PM
         }

  • Printing Date in a Custome Format

    hi,
    I want to know how to get date in a custome format in print layout designer...for exmple the date is given as 09/10/07 but i need Day - 09 , Month - 10 , Year - 07 seperately in 3 text fields...
    Thanks
    Malinda Wellawa

    Malinda,
             In Print Layout properties the options is only for free text or database or formula or for text box..
    U verify with the properties
    Thanks,
    Anitha

  • Recovering data from a newly formatted hard drive

    Has anyone had any experience with programs that recover data from a newly formatted hard drive?  There seem to be a lot of programs out there to do this, but, a) do they work, and b) which one worked best for you? 

    Ive had so and so success with a freeware utility called "Recuva"
    http://www.recuva.com/
    Its from the makers of CCleaner.
    *******DISCLAIMER********
    I am not an employee of BBY in any shape or form. All information presented in my replies or postings is my own opinion. It is up to you , the end user to determine the ultimate validity of any information presented on these forums.

  • How to convert Date in varchar(50) format MM/DD/YYYY HH:MM into YYYY-MM-DD format using MS SQLServer 2008 R2 ?

    Hi,
    I am getting the error "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value."
    when converting date in format Date in varchar(50) format MM/DD/YYYY HH:MM into YYYY-MM-DD format using MS SQLServer 2008 R2.
    Please note that the date in column is Date(varchar(50), null).
    I used the following syntax:
    SELECT  CONVERT(VARCHAR(10), Date, 102) AS Day
    FROM   dbo.[RCap_2G MM/Operator]
    WHERE  (CONVERT(VARCHAR(10), Date, 102) > { fn NOW() } - 1)

    As noted above, either use ISDATE or TRY_CONVERT with the correct conversion style number:
    -- SQL Server 2012 code
    DECLARE @Date varchar(50) = '10/23/2006 10:20';
    SELECT TRY_CONVERT(DATE, @Date, 101) AS Day
    -- 2006-10-23
    Datetime conversion blog:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for

  • How can I display step info in User Interface with Tracing Disabled?

    I'm trying to modify the CVI Operator Interface application to update the execute panel with some step information during the execution of the program. i.e. I want to display the measurement, high & low limits during the run WHEN TRACING IS DISABLED.

  • Stereo turntable PS-LX300USB not recognized by Win 7?

    Bought turntable with Sound Stage 9 to transfer vinyl back in 2009.  Used only briefly on my PC and put away until now 2013.  Seems, HP computer with Win 7 is not recognizing turntable on plugging in USB.  You can hear the "ding" but no device is rec

  • How to revoke and grant permission in java using Security Manager  ??

    I like to revoke and grant permission through java code..can anybody give me a sample code.

  • Reference Text in Treasury posting

    Dear Expert, Is there a place/field that I can use while posting Money Market (TM01) to enter the reference/short text? This reference/short text will then be displayed in FBL5N or FBL3N. This is needed as easy to monitor the transaction. Can you ple

  • Restoration of Back up in TFTP

    I am doing restoration of back up through below command copy tftp: running config But issue  file seems to be loading  and getting invalid input detected finally it got copied.. But configuration was still same.. Restoration configuration was not hap