calculate date 2 wks prior to date field

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

calculate date 2 wks prior to date field

wsu_wright
I have a date variable (mm-dd-yyyy) which displays the payroll end date.  I need to calculate a payroll begin date that occurs 2 weeks prior to the payroll end date.  I've found several means to create a date and determine length of time but none to create a date from a known date.

Thanks in advance.

David

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: calculate date 2 wks prior to date field

wsu_wright
Ariel,

The syntax works great!  I opened another dataset which had both end & start dates, & created a test variable using your command & it matched prefectly with the start date.

Thanks again.

DW



---- Ariel Barak <[hidden email]> wrote:

> Hi David,
>
> You'll probably get a better response from someone else on the list but you
> could try this untested syntax:
>
> COMPUTE BeginDate=EndDate-(86400*14).
> EXE.
>
> FORMAT BeginDate (ADATE10).
>
> Let me know if it works.I think that should work...if it doesn't, someone
> else on the list will reply.
>
> -Ariel
>
>
> On Sat, Jul 12, 2008 at 11:47 AM, David Wright <[hidden email]> wrote:
>
> > I have a date variable (mm-dd-yyyy) which displays the payroll end date.  I
> > need to calculate a payroll begin date that occurs 2 weeks prior to the
> > payroll end date.  I've found several means to create a date and determine
> > length of time but none to create a date from a known date.
> >
> > Thanks in advance.
> >
> > David
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message to
> > [hidden email] (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send the command
> > INFO REFCARD
> >

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD