[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: How do I know What Qtr of Year it is !



> ----------
> From:         Dominick LoGiudice[SMTP:dlogiudice@PINE.VPCC.SUNYSB.EDU]
> Sent:         Thursday, April 08, 1999 1:31 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      How do I know What Qtr of Year it is !
>
> I am writing an sqr that needs to look for qtr data. Example if
> I ran today the run date I have is formatted like this 19990408. I can
> substr out
> the month as 04.  Using 04 I need to look on a table if the date is '01'
> or '02' or
> '03'. Based on the run date the qtrs I need to look for will always
> change.  I next
> run this sqr in July so my qtr rundate will be 07 so I need to look for
> '04' , '05' or
> '06'.  Is there a delivered sqr to do this.
> I guess the short story is I need to know what 3 months are the previous
> qtr.
> thanks
>
Dear Mr. Logiudice,
        With regards to what period ending is tied with what quarter, if you
have a pay calendar, you could use it ? If I am not mistaken, sometimes the
pay calendar are preset or pre-defined and other times one may have to
define it and maintain it on an on-going basis.

As for the pay calendar, the following is what we have at Ruan :

SQL> desc ps_pay_calendar;

 Name                            Null?    Type
 ------------------------------- -------- ----
 COMPANY                         NOT NULL VARCHAR2(3)
 PAYGROUP                        NOT NULL VARCHAR2(3)
 PAY_END_DT                      NOT NULL DATE
 RUN_ID                          NOT NULL VARCHAR2(3)
 PAY_BEGIN_DT                    NOT NULL DATE
 CHECK_DT                        NOT NULL DATE
 PERIOD_WEEKS                    NOT NULL NUMBER(4)
 CALENDAR_YEAR                   NOT NULL NUMBER(4)
 QTRCD                           NOT NULL VARCHAR2(1)
 MONTHCD                         NOT NULL VARCHAR2(2)
 PAY_PERIOD                      NOT NULL VARCHAR2(1)
 PAY_PDS_PER_YEAR                NOT NULL NUMBER(4)
 ACCRUAL_PCT                     NOT NULL NUMBER(5,3)
 REVERSE_FLAG                    NOT NULL VARCHAR2(1)
 PAY_SHEETS_RUN                  NOT NULL VARCHAR2(1)
 PAY_PRECALC_RUN                 NOT NULL VARCHAR2(1)
 PAY_CALC_RUN                    NOT NULL VARCHAR2(1)
 PAY_CONFIRM_START               NOT NULL VARCHAR2(1)
 PAY_CONFIRM_RUN                 NOT NULL VARCHAR2(1)
 PAY_CHECKS_RUN                  NOT NULL VARCHAR2(1)
 PAY_OFF_CYCLE                   NOT NULL VARCHAR2(1)
 PAY_OFF_CYCLE_CLS               NOT NULL VARCHAR2(1)
 GL_INTERFACE_RUN                NOT NULL VARCHAR2(1)
 SINGLE_CHECK                    NOT NULL VARCHAR2(1)
 TF_TAX_FILE_BUILT               NOT NULL VARCHAR2(1)
 TF_TAX_FILE_XMIT                NOT NULL VARCHAR2(1)

Hope it helps.

Krishnan Sarangarajan
ksaranga@ruan.com
  Ruan Transportation
                3200 Ruan Center (DSM 6th Floor)
 Des Moines, IA  50309
[O] (515) 245-5655
[F] (515) 247-2284