Re: Sum,Sort, Format, and Date Range

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: fredg (fgutkind_at_example.invalid)
Date: 03/08/05


Date: Tue, 08 Mar 2005 00:36:58 GMT

On Mon, 7 Mar 2005 13:23:06 -0800, finster26 wrote:

> I have a DATE/TIME field and a Currency field.
>
> I am formatting the date to "mmmm, yyyy" then GROUPING the by month/year and
> SUM the Currency field.
>
> I want to be able to select records between dates. I cannot use criteria in
> the formatted date field to select the records bewteen dates. Formatted date
> is a String. I also want to sort the formatted Date field but I it will not
> sort correctly because it's a String.
>
> SELECT DISTINCTROW Format([DIE HEADINGS].[DATE],'mmmm yyyy') AS [DATE By
> Month], Sum([DIE HEADINGS].[COST DIECOST]) AS [Sum Of COST DIECOST]
> FROM [DIE HEADINGS]
> GROUP BY Format([DIE HEADINGS].[DATE],'mmmm yyyy');
>
> What is the appropriate way to add the criteria and sort the records by
> Month/Year?
>
> Thanks,
>
> Bob

To add emphasis to MGFoster's reply regarding your use of Date as a
field name:

See the Microsoft KnowledgeBase article for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

-- 
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Relevant Pages

  • Re: Dlookup and dates
    ... Reserved Words in Microsoft Access" ... When using a Date datatype criteria in Access, ... If the above DLookUp is being done on the form you can ...
    (microsoft.public.access.formscoding)
  • Re: VBA - Stuck with criteria for report
    ... > Hi - I am trying to send some criteria to a report in Access using the code ... For additional reserved words, ... Reserved Words in Microsoft Access' ...
    (microsoft.public.access.reports)
  • Re: Formatting the month of a date
    ... I'm extracting the month of a date in a query using Month. ... As criteria on this column you need to refer back to the combo box on ... For additional reserved words, ... Reserved Words in Microsoft Access' ...
    (microsoft.public.access.queries)
  • Re: Return Top 10 Record
    ... Below is the SQL Statement of my query.I sort the Fields ... HEIGHT descently,But I want the query return the 10 Highest ... For additional reserved words, ... Reserved Words in Microsoft Access' ...
    (microsoft.public.access.queries)
  • Re: My Head Hurts!! Parameter Date Query
    ... I have a query that was working fine but like some of us we just cant stop ... I have a query with a orderdate, and in the criteria it has the code: ... For additional reserved words, ... Reserved Words in Microsoft Access' ...
    (microsoft.public.access.queries)