Intermittent Date Format Changes

  • I hope someone can shed some light on this.

    I have a VB6 application that connects to a SQL Server 7 database.

    All dates are sent to the server in YYYY-MM-DD format.

    The date is usually stored correctly on the database, but occasionally the month and day are reversed.

    The regional settings on the clients and server are all Irish.

  • Where are you checking the dates when you see them reversed?

    Nigel Moore
    ======================

  • Hi Nigel,

    The customer is seeing the problem in VB.

    I checked the data in QA to confirm what the customer has seen.

    I have now looked at the VB code, rather than beleive the developers.

    In most cases, dates are being passed to SQL Server as yyyy-mm-dd.

    Where the date is held as a date in VB, they have used a function to convert the date to a dd/mm/yyyy string before passing it to the database.

    I think this is the source of the problem.

    Thanks for your reply,

    David.

  • Have them convert instead to YYYYMMDD instead as the ISO standard will not fail. If there is nothing on the SQL end to ensure it understands 01/02/2005 is Feb 1st and not Jan 2nd explicitly I have seen issues. ISO format has never failed to my knowledge.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply