Results 1 to 3 of 3

Thread: [RESOLVED] Non-US Date Format in Crystal

  1. #1

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    Resolved [RESOLVED] Non-US Date Format in Crystal

    I'm having a lot of trouble with dates in my Crystal reports. Basically, it insists on thinking that everything is in the US date format. I've tried the following varieties in my stored procedure:

    Code:
    Declare     @CycleDate      As  SmallDateTime
    
    Select      @CycleDate      =   '12-Jul-2012'
    
    Select      InterfaceDate1  =   @CycleDate
              , InterfaceDate2  =   '12 Jul 2012'
              , InterfaceDate3  =   Convert(VarChar, @CycleDate, 106)
    Now, InterfaceDate1 is recognised as a date by Crystal, i.e. if I insert that field into my report, right-click it and choose "Format Object", it gives me all the date formatting options. However, despite the fact it's coming as a date of '12-July-2012', Crystal insists on seeing it as '07-December-2012'.

    Crystal recognises that InterfaceDate2 is a VarChar and doesn't give me the date formatting options. It displays properly as '12 Jul 2012'.

    Crystal recognises that InterfaceDate3 is a VarChar and doesn't give me the date formatting options. However, despite the fact that it's a VarChar of '12 Jul 2012', it displays it as '07 Dec 2012'.

    My regional settings are currently set to "English (UK)". If I set them to "English (US)" the problem goes away, but obviously, being in the UK, I don't want to change my regional settings.

    This behaviour is clearly complete bobbins. Does anyone know how to get around it? I'm using the Crystal editor that comes with VS 2008, and the world's oldest Sybase database (v11).

    Any help would be greatly appreciated.
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,517

    Re: Non-US Date Format in Crystal

    Don't have an answer for you but this forum has CR experts, http://search.sap.com/ui/scn#query=c...cm_v_Site11%29

  3. #3

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    Re: Non-US Date Format in Crystal

    I finally managed to track this down. The problem wasn't actually where I'd thought it was.

    I was passing in a parameter from my VB code, but the parameter field in the report was a string (despite the fact that it relates to a SmallDateTime field in the underlying stored procedure), and I was passing in a date. It was at that point that it translated it incorrectly, so the SP received a parameter value of 07-Dec-2012 and therefore passed that back out. I've had to get my VB code to do a ToString("dd-MMMM-yyyy") on my parameter, and it now works.
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width