Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Where to Set Datetime Format Configuration Property ?

    SmartGWT Power 2.3, using nightly build from today, 12/19/2010.

    I read in post #14188 that there is a new property to support SQL Server date time formats.

    What is that property and how do I set it please?

    I'm using SQL Datasources and I'm seeing generated SQL WHERE clauses like this:

    Code:
    WHERE ((createdAtDayPacific >= '20101218 00:00:00' AND createdAtDayPacific IS NOT NULL) AND (createdAtDayPacific <= '20101218 03:00:00' OR createdAtDayPacific IS NULL)
    And I want:
    Code:
    WHERE ((createdAtDayPacific >= '2010-12-18 00:00:00' AND createdAtDayPacific IS NOT NULL) AND (createdAtDayPacific <= '2010-12-18 03:00:00' OR createdAtDayPacific IS NULL)
    Thanks much.

    #2
    We had another user claiming that some version of SQL Server would interpret the latter SQL (what you say you want) in a locale-dependent way.

    1. What difference are you seeing in behavior between these two SQL statements?

    2. What's your version of SQL Server and of your JDBC driver?

    Comment


      #3
      I'm using SQL Server 2008 R2 and the Microsoft SQL Server JDBC driver, sqljdbc4.jar

      Now the embarrassing part, I found a bug (my code) that was messing up the results, not this generated query. I'm seeing that they both work the same and return the same results.

      Apologies for the invalid post.

      Out of curiosity, how would I configure that property? Thanks.

      Comment


        #4
        In server.properties:

        Code:
        sql.sqlserver.defaultDateFormat: yyyyMMdd
        sql.sqlserver.defaultDateTimeFormat: yyyyMMdd HH:mm:ss
        Here this assumes you've using the default "sqlserver" as your dbName.

        Comment

        Working...
        X