Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Quarterly query

Discussion in 'Information Technology' started by msmuzila@gmail.com, Jul 28, 2006.

  1. msmuzila@gmail.com

    msmuzila@gmail.com
    Expand Collapse
    Guest

    for queries, what is the quarterly date format. I have month and year:

    Month([SHIP_DATE])
    Year([SHIP_DATE])

    What is quarterly?
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Rob Parker

    Rob Parker
    Expand Collapse
    Guest

    There is no standard "quarter" in Access. If you want one, you'll have to
    write your own custom function to provide it - and that will also allow you
    to define exactly what you want it to be.

    Rob

    <msmuzila@gmail.com> wrote in message
    news:1149221311.211464.232980@u72g2000cwu.googlegroups.com...
    > for queries, what is the quarterly date format. I have month and year:
    >
    > Month([SHIP_DATE])
    > Year([SHIP_DATE])
    >
    > What is quarterly?
    >
     
  4. Peter Danes

    Peter Danes
    Expand Collapse
    Guest

    The SWITCH function might do what you want. Something like (air code):

    Quarter:
    Switch(Month([SHIP_DATE]),1,Month([SHIP_DATE]),1,Month([SHIP_DATE]),1,
    Month([SHIP_DATE]),2,Month([SHIP_DATE]),2,Month([SHIP_DATE]),2,
    Month([SHIP_DATE]),3,Month([SHIP_DATE]),3,Month([SHIP_DATE]),3,
    Month([SHIP_DATE]),4,Month([SHIP_DATE]),4,Month([SHIP_DATE]),4))

    This should give you 1 for months Jan, Feb, Mar, 2 for Apr, May Jun, etc.

    Another way might be:

    Quarter: INT(Month([SHIP_DATE])/4)+1


    Pete


    "Rob Parker" <NOSPAMrobpparker@optusnet.com.au.REMOVETHIS> pí¹e v diskusním
    pøíspìvku news:%23vrJy0fhGHA.3996@TK2MSFTNGP03.phx.gbl...
    > There is no standard "quarter" in Access. If you want one, you'll have to
    > write your own custom function to provide it - and that will also allow

    you
    > to define exactly what you want it to be.
    >
    > Rob
    >
    > <msmuzila@gmail.com> wrote in message
    > news:1149221311.211464.232980@u72g2000cwu.googlegroups.com...
    > > for queries, what is the quarterly date format. I have month and year:
    > >
    > > Month([SHIP_DATE])
    > > Year([SHIP_DATE])
    > >
    > > What is quarterly?
    > >

    >
    >
     
  5. msmuzila@gmail.com

    msmuzila@gmail.com
    Expand Collapse
    Guest

    Quarter: INT(Month([SHIP_DATE])/4)+1 works great, just had to put a >0
    in the criteria

    thanks
     
  6. Michael H

    Michael H
    Expand Collapse
    Guest

    Here's an additional method:

    DatePart("q", [SHIP_DATE])

    -Michael



    "msmuzila@gmail.com" wrote:

    > Quarter: INT(Month([SHIP_DATE])/4)+1 works great, just had to put a >0
    > in the criteria
    >
    > thanks
    >
    >
     
  7. Rob Parker

    Rob Parker
    Expand Collapse
    Guest

    Hi Michael,

    Thanks for that post - I wasn't aware of that format within the DatePart
    function.

    However, it might still make sense for the OP to consider writing his own
    function. That one gives 1 for Jan to Mar, 2 for Apr to Jun, etc. This may
    not be appropriate; eg. here in Oz, financial year reporting considers Jul
    to Sep as quarter 1, etc. And, IIRC, the UK financial year start in April.
    Or, a custom function would allow you to generate a "rolling" quarter based
    on the current month.

    Rob

    "Michael H" <MichaelH@discussions.microsoft.com> wrote in message
    news:9FC95628-15D7-4DD3-824B-4140E792BCB3@microsoft.com...
    > Here's an additional method:
    >
    > DatePart("q", [SHIP_DATE])
    >
    > -Michael
    >
    >
    >
    > "msmuzila@gmail.com" wrote:
    >
    >> Quarter: INT(Month([SHIP_DATE])/4)+1 works great, just had to put a >0
    >> in the criteria
    >>
    >> thanks
    >>
    >>
     
  8. Peter Danes

    Peter Danes
    Expand Collapse
    Guest

    Glad it helped.

    Pete



    <msmuzila@gmail.com> píse v diskusním príspevku
    news:1149252347.461806.284370@u72g2000cwu.googlegroups.com...
    > Quarter: INT(Month([SHIP_DATE])/4)+1 works great, just had to put a >0
    > in the criteria
    >
    > thanks
    >
     
  9. lkk

    lkk
    Expand Collapse
    Guest

    <msmuzila@gmail.com>
    ???????:1149252347.461806.284370@u72g2000cwu.googlegroups.com...
    > Quarter: INT(Month([SHIP_DATE])/4)+1 works great, just had to put a >0
    > in the criteria
    >
    > thanks
    >
     

Share This Page