[AccessD] Date field sort

Stuart McLachlan stuart at lexacorp.com.pg
Fri Jan 5 17:24:21 CST 2007


In the query design view, right click on the date field, select properties 
and make sure that the "Format" box is empty. If there is a date format in 
there, the data will be passed as a string, even if you use a CDate() 
expression.
 

On 5 Jan 2007 at 16:22, Elam, Debbie wrote:

> This is not precisely formatting.  It is explicitly defining this as a date
> type for sorting purposes.  
> 
> I have both used this and not.  They alternate as to which sorts the field
> like a date or like a string.  Since the underlying field is a date field, I
> did not do this originally as it was not necessary and should have stayed
> that way.
> 
> I see options in the report for changing how it looks visually, but not it's
> data type (and therefore it's sort properties).  If this is something I have
> missed, let me know where to find it.
> 
> Debbie
> 
> -----Original Message-----
> From: Stuart McLachlan [mailto:stuart at lexacorp.com.pg] 
> Sent: Friday, January 05, 2007 4:02 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Date field sort
> 
> 
> Are you applying a format to the Date field in the query underlying the
> report?  That will have this sort of effect.  As a general rule, you
> shouldn't do any formatting of data in queries which are used for reports.
> Do all of the formatting in the report 
> 
> On 5 Jan 2007 at 10:03, Elam, Debbie wrote:
> 
> > I have an odd problem with a report that sorts on a date field.
> > 
> > 3 times now for no reason I can discern the sorting gets strange.  The
> first
> > time it happened, I used Cdate([MyDateField]) and it started sorting
> > correctly again.  Then I had to take the Cdate() off, then put it on
> again.
> > Only one or the other works, but they alternate.  
> > 
> > The wrong sorts will sort like a string.  Months are grouped together
> > regardless of year and december comes before January.  And yes, I have had
> > it sort like a string when I used Cdate().  
> > 
> > Has anyone seen anything like this in the past?
> > 
> > Debbie
> > - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1)
> subject
> > to the Attorney-Client Privilege, (2) an attorney work product, or (3)
> > strictly confidential. If you are not the intended recipient of this
> > message, you may not disclose, print, copy or disseminate this
> information.
> > If you have received this in error, please reply and notify the sender
> > (only) and delete the message. Unauthorized interception of this e-mail is
> a
> > violation of federal criminal law. This communication does not reflect an
> > intention by the sender or the sender's client or principal to conduct a
> > transaction or make any agreement by electronic means.  Nothing contained
> in
> > this message or in any attachment shall satisfy the requirements for a
> > writing, and nothing contained herein shall constitute a contract or
> > electronic signature under the Electronic Signatures in Global and
> National
> > Commerce Act, any version of the Uniform Electronic Transactions Act or
> any
> > other statute governing electronic transactions. -- AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd Website:
> > http://www.databaseadvisors.com
> 
> -- 
> Stuart
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> - JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject
> to the Attorney-Client Privilege, (2) an attorney work product, or (3)
> strictly confidential. If you are not the intended recipient of this
> message, you may not disclose, print, copy or disseminate this information.
> If you have received this in error, please reply and notify the sender
> (only) and delete the message. Unauthorized interception of this e-mail is a
> violation of federal criminal law. This communication does not reflect an
> intention by the sender or the sender's client or principal to conduct a
> transaction or make any agreement by electronic means.  Nothing contained in
> this message or in any attachment shall satisfy the requirements for a
> writing, and nothing contained herein shall constitute a contract or
> electronic signature under the Electronic Signatures in Global and National
> Commerce Act, any version of the Uniform Electronic Transactions Act or any
> other statute governing electronic transactions. -- AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd Website:
> http://www.databaseadvisors.com

-- 
Stuart





More information about the AccessD mailing list