Quarterly Queries - Automating the Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • egrill
    New Member
    • Jul 2007
    • 16

    Quarterly Queries - Automating the Date

    I can access the date field from OBCC tables and do the normal date range for a quarterly report for each quarter

    I need the formula so I can sort the records into individual quarter having them side by side with the appropriate sum of the date.

    For example the result would look like this

    Name QTR 1 QTR 2 QRT 3
    ABC Comp $10000 $12000 $ 120000
    DEF Company $9999 $30000 $ 40000

    All in the same query or at least using the same query to get the sum

    I am having trouble programming the date range to read the correct quarter -jan-mar. apr-jun, jul - sept, oct-dec.

    Thank you in advance for your help
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    You should use the Format() function to deliver the quarter like:

    select format(Datefiel d,"YYYY-Q") as YearQuarter, ...

    Next you can use a query like this in a crosstable query to get the data in columns with the YearQuarter as column heading.

    Idea ?

    Nic;o)

    Comment

    Working...