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

Re: SQR Datediff?



Just a quick clarification of Peoplesoft date procedures -- the Peoplesoft
date routines are all database independent (for the databases that
Peoplesoft supports). Remember that Peoplesoft had these routines long
before SQR introduced them in 4.0 onwards. Within the Peoplesoft
architecture (opsys.sqc, setenv.sqc, datetime.sqc, datemath.sqc...), if the
Peoplesoft supplied date procedures are used, then you do not have to worry
about your underlying database -- it will work (just take a look at
datemath.sqc to see how it has been coded!).

BTW, the Peoplesoft procedure for Difference in Dates is:
dtu-diff-days($dtu_date1, $dtu_date2, #dtu_days).

Anyway, using SQR's own DateDiff will definitely be more efficient than
calling Peoplesoft's date procedures!

-Sam Rao





> -----Original Message-----
> From: Sam Spritzer [SMTP:SSpritzer@GW.CTG.COM]
> Sent: Tuesday, August 24, 1999 4:29 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      Re: SQR Datediff?
>
> I have noticed a lot of posting with reference to the various systems that
> have their own date arithmetic routines.
>
> I think it is important to keep in mind that SQR is not platform
> dependent.  Therefore, if you use its datediff function, you shouldn't
> have to worry about how PeopleSoft et al performs similar functions.
>
> SQRly yours,
> Sam
>
> <<< Nina Chou <nchou@BOOKCRAFTERS.COM>  8/24  5:04p >>>
> The following codes is what I extract from PeopleSoft AR32001.SQR.  Looks
> like
> the datediff are for SYBASEand MICROSOFT only.  There is a DAYS function
> for
> DB2.  For Oracle, you can just subtract the date variables.
> --------------------------------------------------------------------------
> -------------------------------------------------------
> #ifdef SYBASE
>  DATEDIFF(DAY, PS_STMT_ITEM1_TMP.DUE_DT, PS_STMT_ITEM1_TMP.ST_DT),
> #else
>  #ifdef MICROSOFT
>   DATEDIFF(DAY, PS_STMT_ITEM1_TMP.DUE_DT, PS_STMT_ITEM1_TMP.ST_DT),
>  #else
>   #ifdef DB2ALL
>    DAYS(PS_STMT_ITEM1_TMP.ST_DT) - DAYS(PS_STMT_ITEM1_TMP.DUE_DT),
>   #else
>    PS_STMT_ITEM1_TMP.ST_DT - PS_STMT_ITEM1_TMP.DUE_DT,
>   #endif
>  #end-if
> #end-if
>
>
>
>
>
> Sam Spritzer <SSpritzer@GW.CTG.COM> on 08/24/99 04:06:05 PM
>
> Please respond to SQR-USERS@list.iex.net
>
> To:   Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
> cc:    (bcc: Nina Chou/BookCrafters)
> Subject:  Re: SQR Datediff?
>
>
>
>
> I m tossing this in the wind but what version of SQR are you on?  Datediff
> is
> new for ver. 4.
> Sam
>
> <<< "Buchanan, Timothy" <buchanan@BIPERF.COM>  8/24  3:36p >>>
> Anyone get datediff function to work in SQR in an Oracle environment? I am
> trying to find the difference in days between 2 dates using the following
> code in a SQL statement:
>
>         LET #dif = DATEDIFF($asoftoday, $effdt, 'DAY')
>
> I get the error: Function or operator 'datediff' requires date argument.
>
> Using debug, I can see that $asoftoday and $effdt are equal to the
> following:
>
> ASOFTODAY = 24-AUG-1999
> EFFDATE = 01-JUL-1998
>
> Hmm..sure look like dates to me. I even tried to use STRTODATE on each
> variable, but it still gives me the same error. Any help?? Thanks.
>
> Timm