Julian Style Date Formatting

Post Author: Brian Black
CA Forum: Formula
Our AS/400 based banking software provides dates in the format yyyyddd (i.e. 2007091 = April 01, 2007).  Has anyone had any experience working with a date of this format in Crystal.  The date comes out of the system as a numeric type.  The year is easy to deal with via cstr() and left(), etc. but I am struggling with how to deal with the yyy portion in a way that deals with leap years, etc.
Any help with how to convert this to a standard date type would be greatly appreciated!!!
Thanks,
Brian Black

Post Author: Brian Black
CA Forum: Formula
Awesome.  That worked great.
NUMBERVAR X := YYYYddd; //Your date//DATESERIAL(TONUMBER(TOTEXT(X,0,'','')[1 TO 4]),1,TONUMBER(TOTEXT(X,0,'','')[5 TO 7])); 
This is a huge time saver for me!
Thanks!

Similar Messages

  • No English language setting with European date formatting available

    The English language setting in my iPod bought in Finland forces date format to the American MM/DD/YYYY style. There is no English language setting that would result in the European DD.MM.YYYY or DD/MM/YYYY format.
    Either making date formatting separately configurable (as time formatting already is), or adding another English locale with European-style date formatting solves this problem.

    Yes I agree, date format should be language independant. This is very annoying!

  • Date format in different from System Preferences

    The date display in the top right corner of the menu bar is not according to the custom setting I have defined in System Preferences.
    In Language & Region, I defined the date format to be <day of month number> < name of month> <year>.
    The menu bar however displays the date in American style date format of <name of month> <day of months number>.
    Is there any way to have Numbers pick up the date format from Language & Region as defined in System Preferences?

    The date display in the top right corner of the menu bar is not according to the custom setting I have defined in System Preferences.
    In Language & Region, I defined the date format to be <day of month number> < name of month> <year>.
    The menu bar however displays the date in American style date format of <name of month> <day of months number>.
    Is there any way to have Numbers pick up the date format from Language & Region as defined in System Preferences?

  • Convert date julian to regular date format in BI Publisher

    Hello,
    How to convert Julian format date 'SAAJJJ' to regular date format in BI Publisher 'YYYY/MM/DD'
    help mi please.

    Hello,
    help mi please,
    How to convert Julian format date 'SAAJJJ' to regular date format in BI Publisher 'YYYY/MM/DD'
    Thanks.

  • How to convert Julian format date to regular date format

    Hi,
    I'm trying to convert Julian date(e.g. 2455657) passed to regular date format(e.g. 2011/4/6), but the Julian date is shown without conversion.
    I set the following code, and changed the format to "Date" with "yyyy/M/d" format, but "2455657" is displayed, not "2011/4/6".
    <?xdofx:to_date(HIRE_DATE_J,'J')?>
    I also set the following with "Text" format field, but it still shows "2455657".
    <?xdofx:to_char(to_date(HIRE_DATE_J,'J'),'YYYY/MM/DD')?>
    How can I convert Julian format to regular date format?
    Thanks in advance
    Toru

    Take a look at the following post: http://blogs.oracle.com/xmlpublisher/2007/08/more_date_calculations.html
    and look at the comments section. Based on the comments, it appears that you can not convert from Julian format and you would have to do this in your query.
    Thanks,
    BIPuser

  • Converting a Java style date into useful format

    If I am calling a web service that returns a Java style date as a numeric value, such as 1177651563767 (milliseconds since 1 Jan 1970), how can I display this as a human readable date (hh:mm:ss dd-mm-yyyy? I have looked at the <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/40/a228173435437394f54c56de571ca4/frameset.htm">SAP help pages on date functions</a> and the
    <a href="https://wiki.sdn.sap.com/wiki/display/VC/DateandTime+Formats">wiki page on date and time formats</a>, but neither seems to help.
    My Java date is a numeric.
    Thanks

    Hi Michael,
    you can call the webservice with another webservice or an RFC and then use Java or ABAP to convert the value into the right format. My opinion is as you mentioned that there is no way with VC. Maybe you can use a time function (DADD as it is described <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/40/a228173435437394f54c56de571ca4/frameset.htm">here</a> and sum up to 01/01/1970 your [value in seconds]/60 this should work, but I never tested it.      
    Maybe this works, but this isn't a good solution anyway.
    Best Regards,
    Marcel

  • Group by month/year from DATE FORMAT column

    Hi Chaps,
    I have a recordset that pulls data from a database, then presents the data in a table. The data is grouped by 'projid', repeated for every 'projid', with a show/hide control, to show all the 'jobid's' relating to that particular 'projid'
    This is what I have so far:
    Code:
    SELECT             
    tbl_projects.projid,
    tbl_projects.projtitle,
    tbl_projects.projdue, DATE_FORMAT(tbl_projects.projdue, '%%d/%%m/%%Y') as projdue_format,
    tbl_projects.projtype, 
    tbl_projects.projinvtype,
    tbl_projects.FK_custid,
    tbl_projects.projcompletedate
    tbl_languaget.langtname,
    tbl_doctype.doctypename,
    tbl_jobs.jobid,
    tbl_jobs.FK_projid,              
    tbl_jobs.jobname,              
    tbl_jobs.FK_langid,              
    tbl_jobs.jobpages,              
    tbl_jobs.jobshipped,
    tbl_jobs.jobinvsent,   
    tbl_jobs.jobtranslatorcharge,    
    'tbl_jobs' as fromtable,
    tbl_customers.custid,
    FROM tbl_projects  
    INNER JOIN tbl_jobs              
    ON tbl_projects.projid=tbl_jobs.FK_projid  
    INNER JOIN tbl_languaget              
    ON tbl_languaget.langtid=tbl_jobs.FK_langid  
    INNER JOIN tbl_customers              
    ON tbl_customers.custid=tbl_projects.FK_custid
    INNER JOIN tbl_costs
    ON tbl_costs.FK_custid=tbl_customers.custid 
    INNER JOIN tbl_doctype
    ON tbl_doctype.doctypeid=tbl_jobs.FK_doctypeid
    WHERE tbl_projects.projstatus='Complete'        
    AND tbl_projects.projinvtype='Costing Sheet'
    AND langtname!='TH'
    AND langtname!='ID'
    AND langtname!='KO'
    AND langtname!='JP'
    AND jobinvsent='y'
    AND FK_custid = %s
    ORDER BY projid ASC", GetSQLValueString($colname_rsInvPending, "int");
    $rsInvPending = mysql_query($query_rsInvPending, $conndb2) or die(mysql_error());
    //$row_rsInvPending = mysql_fetch_assoc($rsInvPending);
    $totalRows_rsInvPending = mysql_num_rows($rsInvPending);
    Code:
    // REPEAT - FOR EVERY PROJECT
      <?php
      $previousProject = '';
      if ($totalRows_rsInvPending > 0) {
      // Show if recordset not empty
        while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
          if ($previousProject != $row_rsInvPending['projid']) {
          // for every Project, show the Project ID
      ?>
    Code:
    // SHOW/HIDE CONTROL
        <tr>
        <td colspan="9" class="highlight"><span class="blueBold"><a href="#" onclick="toggle2('proj1<?php echo $row_rsInvPending['projid'] ?>', this)"><img src="../../Images/plus.gif" border="0" /></a> <?php echo $row_rsInvPending['projid'] ?> - </a></span><span class="blueNOTBold"><em><?php echo $row_rsInvPending['projtitle'] ?></em></span></td>
        </tr>
    Code:
    // SHOW/HIDE
        <?php $previousProject = $row_rsInvPending['projid']; } ?>
        <tr class="proj1<?php echo $row_rsInvPending['projid'] ?>" style="display:none">
        <td>column 1</td>
        <td>column 2</td>
    What I want, is to put in another grouped by stage, where the 'projid's' themselves are in a show/hide region, grouped by 'projcompletedate' (year/month). 'projcompletedate' is in DATE format, but how to I get PHP/SQL to take the month and year and then group them correctly?

    Hi David, I'm not sure if I've got this right, would you mind looking at my latest code?:
    <table border="0" cellpadding="0" cellspacing="0" id="tblinvoice">
        <tr>
          <th>Job Title</th>
          <th>Type</th>
          <th>Language</th>
          <th>Translator</th>
          <th>Total</th>
          <th>Full</th>
          <th>Fuzzy</th>
          <th>Proof</th>
          <th>Full Price</th>
          <th>Discount Price</th>
          <th>Document Format</th>
          <th>Pages</th>
          <th>Typesetting Cost</th>
          <th>EN Proofreading Cost</th>
          <th>Total</th>
          <th>Translator Charge</th>
          <th>Profit</th>
          <th>Profit Percentage</th>
        </tr>
        <?php
          $previousMonth = '';
          if ($totalRows_rsInvPending > 0) {
          // Show if recordset not empty
          do ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
          if ($previousMonth != $row_rsInvPending['themonth']) {
          // for every Month, show the Month Name
       ?>
        <tr>
          <td colspan="18" class="highlight"><?php echo $row_rsInvPending['theyear'] ?> - <?php echo $row_rsInvPending['themonth'] ?></td>
        </tr>
        <?php $previousMonth = $row_rsInvPending['themonth']; } ?>
        <?php
          $previousProject = '';
          if ($totalRows_rsInvPending > 0) {
          // Show if recordset not empty
          while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
          if ($previousProject != $row_rsInvPending['projid']) {
          // for every Project, show the Project ID
       ?>
       <tr>
        <td colspan="18" class="highlight"><span class="blueBold"><a href="#" onclick="toggle2('proj1<?php echo $row_rsInvPending['projid'] ?>', this)"><img src="../../Images/plus.gif" border="0" /></a> <?php echo $row_rsInvPending['projid'] ?> - </a></span><span class="blueNOTBold"><em><?php echo $row_rsInvPending['projtitle'] ?></em></span></td>
        </tr>
        <?php $previousProject = $row_rsInvPending['projid']; } ?>
        <tr class="proj1<?php echo $row_rsInvPending['projid'] ?>" style="display:none">
            <td><?php echo $row_rsInvPending['jobname']; ?></td>
            <td><?php echo $row_rsInvPending['projtype']; ?></td>
            <td><?php echo $row_rsInvPending['langtname']; ?></td>
            <td><?php echo $row_rsInvPending['translator']; ?></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <?php } while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)); ?>
          <?php } // Show if recordset not empty ?>

  • Date format in Email notifications

    Service Desk 7.01
    Windows 2008
    MS SQL DB
    When the notification emails are sent out to the user, the date format is in US format (mm/dd/yyyy) and we would like it to be Aus format (dd/mm/yyyy).
    I have set the Default Date Style under Setup > Customer and in Setup > Email > Templates Date Style at the bottom of the window, but it is still showing as the US format.
    Is there another place that it needs to be changed?

    Originally Posted by Madgwicks
    Service Desk 7.01
    Windows 2008
    MS SQL DB
    When the notification emails are sent out to the user, the date format is in US format (mm/dd/yyyy) and we would like it to be Aus format (dd/mm/yyyy).
    I have set the Default Date Style under Setup > Customer and in Setup > Email > Templates Date Style at the bottom of the window, but it is still showing as the US format.
    Is there another place that it needs to be changed?
    It is working in my setup. I modified the date format in setup>Email >Templates and selected Email Summary Templates and modified the format in Date Style. Attach more screen shots.

  • Problem of Date format in Parameter dialog box

    This problem happen In Crystal XI but not in version 8.5. When a parameter dialog box showing up it provides a calander for users to select a date. When the user select a date from the calander the prompt alway return a date in the format of (yyyy-mm-dd) regardless of whatever we set in the Windows's "Regional Settings". In our region we set date as dd-mm-yyyy.
    When we edit the date in the parameter field box to dd-mm-yyyy and click OK the prompt complains and says "the date should be in the format of "yyyy-mm-dd"". Why?. Could Business Objects or anyone let me know is there a way to edit option. In our regional our clients are used to with the date format of dd-mm-yyyy. 
    Thanks,
    Robert

    Thank Sastry,
    With an IT professional or a computer expert it does not seem to be a matter as they understand this is just another way to write date but many of our clients already used to with the dd-mm-yyyy and they are not American. If you say this was by design howcome in CR 8.5 the date in this dialog box follows the format in the regional settings. In CR 8.5 when you change date format in regional setting it reflect immediately in the parameter box. Asume what you say is true I would like to ask Business Objects that this is a backward development or just a way to purse every one in this world to follow the American style.
    Come back to the parameter box. Our clients have used our software that uses CR 8.5 for many years. Not all but many of them just type in the date directly to the box. If this can't be fixed how will our support staff tell our customers? I would like to hear something from Business Objects.
    Rob

  • Wrong Date format in SQL Server

    Hello All,
    I have an asp page with a hidden field that holds
    <%=Date()%>. Because the
    Session.LCID is set to UK this value today would be
    12/03/2007 (UK format).
    When this hidden field is fed into an INSERT Stored Procedure
    in SQL Server
    in my testing environment, the date format that is inserted
    into the
    database is the same as the value in the hidden field eg
    12/03/2007, which
    is what I want.
    Now though, the site has moved to a production web server
    with SQL Server.
    When I perform this exact insert using the same webpages and
    (from what I
    can see) the same SQL Server configuration, the date inserts
    as 03/12/2007,
    US format. This is causing me big problems as the website is
    complete but
    the wrong dateformat is producing some undesirable results.
    The whole site
    is set up to expect the original format and I cannot see why
    this is
    happening.
    Does anyone have any suggestions and more importantly how I
    can change this
    please.

    There is a real issue here and it has nothing to do with the
    way that data
    is formatted on the way out.
    msSQL does seem to always assume that numbers entered in the
    format of
    00/00/00 follow the pattern of MM/DD/YY which is American
    format. So the 8th
    of March entered in UK format of 08/03/2007 ends up being
    intrepreted by SQL
    as 3rd August. However it only does this up to the 12th of
    each month. If
    you enter the 13th of March as 13/03/2007 SQL stores it
    correctly.
    The workaround does seem to enter the number in the
    YYYY-MM-DD format as
    Julian has suggested.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "Lionstone" <[email protected]> wrote in
    message
    news:[email protected]...
    > SQL Server does not store dates in any format. They are
    simply numbers,
    > with the integer part representing date and the
    fractional part
    > representing time. If you do not format dates on the way
    out, then you're
    > leaving things up to your web server (and depending on
    when the dates
    > become strings, it might be the ADO provider and not ASP
    that does the
    > formatting).
    >
    > The only way to reliably format dates the way you want
    is to do so
    > explicitly. You may use CONVERT for SQL Server and
    specify a format
    > option (
    http://msdn2.microsoft.com/en-us/library/aa226054(SQL.80).aspx),
    > or you may use the FormatDateTime function in your ASP
    page.
    > FormatDateTime is locale-aware when it formats dates.
    All you have to do
    > is make sure the locale is set properly (which you seem
    to have done).
    >
    >
    >
    > "TTal" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hello All,
    >>
    >> I have an asp page with a hidden field that holds
    <%=Date()%>. Because
    >> the Session.LCID is set to UK this value today would
    be 12/03/2007 (UK
    >> format).
    >>
    >> When this hidden field is fed into an INSERT Stored
    Procedure in SQL
    >> Server in my testing environment, the date format
    that is inserted into
    >> the database is the same as the value in the hidden
    field eg 12/03/2007,
    >> which is what I want.
    >>
    >> Now though, the site has moved to a production web
    server with SQL
    >> Server. When I perform this exact insert using the
    same webpages and
    >> (from what I can see) the same SQL Server
    configuration, the date inserts
    >> as 03/12/2007, US format. This is causing me big
    problems as the website
    >> is complete but the wrong dateformat is producing
    some undesirable
    >> results. The whole site is set up to expect the
    original format and I
    >> cannot see why this is happening.
    >>
    >> Does anyone have any suggestions and more
    importantly how I can change
    >> this please.
    >>
    >
    >

  • Prompt window Issues-resize and date format setting to 'mm/dd/yyyy' .

    Guys,
            I have two issues which needs to be solved for better reporting.
            I am using url reporting approach to view reports in ActiveX viewer.
            1) I have to set date format to 'mm/dd/yyyy' in parameter prompt window by default It is in yyyy-mm-dd format.
             2) I have to make prompt window with full size screen in order to accommodate more than one date parameter and make it looks better.
         Can any one tell me how to change and fix date format and resize Prompt window?
          Should I open a ticket with business object in order to solve or customize the Crystal Report Server XI R2 configurations for us?
        Please suggest me some probable options for it.
    Sincerely,
    Sanjay Patel
    Edited by: Adlyd Joseph on Feb 3, 2009 7:22 AM

    Hello Adlyd,
    SAP Business Objects does not support customizing Infoview, CR Server, or BusinessObjects Enterprise.  I'll post the content of SAP Business Objects Note 1218598 below that speaks to this.  Even if they could help customize CR Server/Enterprise/Infoview there's no way to change the parameter prompting page.  It's a page that is generated at runtime, and it isn't exposed to any of the BusinessObjects SDK.
    If you want to see if SAP Business Objects can help you with the date format that might be possible.  In North America you can call 1-800-877-2340, and select option 4, and then option 1.
    You can also purchase technical support from the [Online Store|http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300].
    Sincerely,
    Dan Kelleher
    NOTE: This Note was written for BOE XI and XI R2, but it applies to BOE XI 3.0 and 3.1 as well as all versions of CR Server since version XI (v11.0).
    ++++++++++++++++++
    1218598 - Support policy on customizing BusinessObjects InfoView and other applications
    Symptom
    In previous versions of Business Objects products, Business Objects Customer Support had assisted customers with the customization of the ePortfolio and InfoView applications by providing guidance on what changes were required for simple and specific custom features.
    What is the support policy for customizing BusinessObjects XI, XI Release 2, XI 3.0, XI 3.1 InfoView and the other included applications?
    Resolution
    Starting with BusinessObjects XI, code-level customization of InfoView and the other applications included with BusinessObjects XI is not supported and not recommended. These applications include Crystal Reports Explorer and the Central Management Console.
    InfoView is a fully-featured product and can be customized by changing settings in the Central Management Console or by changing values in the application configuration files only.
    Requests for custom features in InfoView or any other included applications will be treated either as enhancement requests, or in extreme cases, as product defects. Any feature that does not function as documented will be treated as a product defect.
    Custom features may also be implemented as part of an Original Equipment Manufacturer (OEM) agreement, or by engaging Business Objects Consulting Services.
    Background Information
    Modification of any of the following file types in BusinessObjects InfoView XI, XI Release 2, XI 3.0, XI 3.1 is not supported:
    .aspx
    .cs
    .vb
    .ascx
    .asax
    .jsp
    .java
    .js
    .htm
    .html
    .csp
    See Also
    For more information, please refer to the technical paper, [Customizing Look and Feel using the CMC and Style Sheets|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/209e174d-be3e-2b10-4d8e-e25a76a6fac1].

  • Date formats and etext templates

    I have been working with etext templates in the last few days and am struggling with date conversion. My XML file has dates in the format DD-MON-YY and my output requires DDMMYYYY. It seems that the format conversion in etext template only works when the xml date is in the format YYYY-MM-DD. I thought I would convert the DD-MON-YY using a combination of TO_DATE and TO_CHAR but TO_CHAR doesn't seem to accept the date mask in etext templates. It looks like I will have to modify the original report unless someone has a way to achieve this in the template.
    Thanks,
    Dave

    I had to change the report. You may be able to change the setup in the reports server to alter the default date format but I didn't want to do that in case it affected the output of any of the other reports that are being run. (N.B. I haven't tried this myself so not sure it can be done).
    The change to the report is pretty simple, I just added a formula column that took a copy of the standard column in the report and used to_char to reformat the date. In my case I reformatted to YYYY-MM-DD so that I could use the template to change the format to the required style. This is just in case there is a later change in the output style so I won't have to modify the report again.
    When the date in the XML is in the format YYYY-MM-DD the documented formatting options work (e.g. "Date , DDMMYYYY" would convert "2005-10-26" to "26102005").

  • OA FRAMEWORK DATE FORMAT IS CONFLICTING WITH PERSONAL DATE FORMAT IN APPRAI

    We are using Self service appraisals forms and added a field using oa framework personalizations. The field is available in the View Object and is mapped to an Attribute (DFF) field. The created item is of style Message Input Text with datatype DATE. This generates a small calendar icon right beside the field. On clicking the icon a calendar window pops up and a date can be selected. The date is inserted in the field in the format 23-Sep-2008. My personal preferences (equal to site preference) state that the date format should be DD-MON-YYYY. When I press continue in the appraisal form the date in the field is automatically changed in 2008/09/23. This obviously causes a validation error (screen popup). When I change my personal preference date format to YYYY/MM/DD everything works fine. However, we do not want to use date format YYYY/MM/DD. What setting determines the date format used for validating by OA Framework pages?

    Thank you for your answer. First of all I am a functional consultant using basic personalization functionality to modify the layout of the standard forms and to enable the display of some of the descriptive flexfield attributes (you are correct) we activated on the competence elements entity. I encounter a problem with the dateformat and the fact that it is changing.. Can you be more precise in telling me where to look for format changes? Note that I do not have access to tools like JDeveloper and decided is that we cannot customize/add/substitute VOs.
    CompetenciesCO and AssessmentsAM are the Controller and Application module involved using VO CompetenceElementsVO. (I try to insert a date value in Attribute2).

  • Create unique Form ID - Help on Date Format in Concat

    I am having problems formating a date value in my concat statement.  I have tried to write is different ways and still can't seem to get the string correct.
    Ideally, I would like to change the date value to a Julian value for the form ID, but I would settle for just mmddyy value without the / or - in between.
    Codes I have tried w/out date format string
    JavaScript - Calculate
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.formattedValue;
    Returns - MO1234Jul8,2010  
    -------------And--------------------
    Program.FormID.rawValue=Program.State.rawValue + Program.ProgramNumber.rawValue + Program.ProgramDate.rawValue;
    Returns - MO12342010-07-08
    FormCalc - Calculate 
    (This one has the current date as a value, but it changes the unique form ID when reopened on another day, that is why I am using ProgramDate)
    Concat(Date2Num(Date(), "ddmmyyy"),Program.State.rawValue, Program.ProgramNumber.rawValue)
    Returns - 0MO1234
    ----------- And --------------------
    if 
    (Program.ProgramNumber.rawValue ne null) then
    $.rawValue
    = CONCAT(Program.State.rawValue, Program.ProgramNumber.rawValue, Program.ProgramDate.formattedValue)
    else
    $.rawValue = ""
    endif 
    Returns - MO1234July8,2010  (formattedValue)
                  MO12342010-07-08 (rawValue)
    What would be the better  language to use, FormCalc or JavaScript for this example?
    I am not all that skilled at coding and use forums like this to help me, so I appreciate any help.
    Thanks in advance - Eve

    Date.prototype.yyyymmdd = function() {
       var yyyy = this.getFullYear().toString();
       var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
       var dd  = this.getDate().toString();
       return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); // padding
    Now, after having spliced the internal Date object, you can do this:
    d = new Date();
    d.yyyymmdd();
    The line above returns today's date: "20100709".

  • Supported date formats for sorting

    Can someone point me to a document describing the supported
    date formats for sorting? I mean, how should I format a date column
    in an XML dataset in order to have this column correctly sorted
    using the Spry framework?
    Thank you and sorry if the question is trivial.

    Thanks, what I have done for the moment as a temporary
    solution is to use the two date formats and have them both inside
    the one cell in the table (the column for the sortable date
    yyyy-mm-dd). In my CSS I have created a style for the first date
    that has it's visibility as hidden. That way it's sorting the Date1
    but only Date2 is being shown to the users as the other cells have
    more than one line of text it doesn't look too off centre.
    <div spry:region="ds2">
    <table width="662">
    <tr>
    <th width="127" class="eventhead"
    spry:sort="Date1">Date</th>
    <th width="151" class="eventhead"
    spry:sort="Type">Type</th>
    <th width="146" class="eventhead"
    spry:sort="Title">Title</th>
    <th width="189" class="eventhead"
    spry:sort="Venue">Venue</th>
    </tr>
    <tr spry:repeat="ds2" spry:setrow="ds2">
    <td height="53" class="event">{Date2}<span
    class="eventhide">{Date1}</span></td>
    <td class="event">{Type}</td>
    <td class="event">{Title}</td>
    <td class="event">{Venue}</td>
    </tr>
    </table>
    </div>
    </div>
    It seems to be working for the moment...

Maybe you are looking for