Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 54584 invoked from network); 6 Aug 2010 12:36:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Aug 2010 12:36:00 -0000 Received: (qmail 93413 invoked by uid 500); 6 Aug 2010 12:36:00 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 93205 invoked by uid 500); 6 Aug 2010 12:35:57 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 93194 invoked by uid 99); 6 Aug 2010 12:35:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Aug 2010 12:35:56 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Aug 2010 12:35:48 +0000 Received: by fxm18 with SMTP id 18so4400093fxm.16 for ; Fri, 06 Aug 2010 05:35:26 -0700 (PDT) Received: by 10.204.163.77 with SMTP id z13mr7769075bkx.169.1281098126262; Fri, 06 Aug 2010 05:35:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.56.20 with HTTP; Fri, 6 Aug 2010 05:35:06 -0700 (PDT) In-Reply-To: References: From: Michael Gentry Date: Fri, 6 Aug 2010 08:35:06 -0400 Message-ID: Subject: Re: Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 Just curious, did you use SortOrder.DESCENDING_INSENSITIVE? mrg On Fri, Aug 6, 2010 at 12:10 AM, Gary Jarrel wrote: > Hi All > > Using SQL Server I have a table with a DATETIME column. When I run a > Cayenne Query with an Oder By clause in Descending Mode, the resulting > SQL looks something like: > > SELECT UPPER(t0.date_created) > FROM product t0 > ORDER BY UPPER(t0.date_created) DESC > > In the Modeler these columns show up as TIMESTAMP > > Is there a reason a UPPER is being used, it seems like it's trying to > do a case insensitive ordering on a non character based column. > > Thank you > > Gary >