LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 10 Sep 2003 19:29:45 -0400
Reply-To:     Raynald Levesque <rlevesque@videotron.ca>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Raynald Levesque <rlevesque@videotron.ca>
Subject:      Re: using date in IF-statement (automation)
In-Reply-To:  <442531134F379D43AB31B66530CC4BEB37D3B0@cheney.lodgenet.com>
Content-type: text/plain; charset=iso-8859-1

Hi

Jim: yes it is a FAQ...

Roland: note that you can also use code which will automatically use the current date. That way, there is no need to change the code each time.

For an example, see file#25 in http://pages.infinit.net/rlevesqu/SampleSyntax.htm#DatesAndTimes

Regards

Raynald Levesque rlevesque@videotron.ca Visit my SPSS site: http://pages.infinit.net/rlevesqu/

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Marks, Jim Sent: September 10, 2003 5:11 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: using date in IF-statement

Roland:

IF date < DATE.DMY(1,9,2003) dummy = 1.

Raynald:

Does this qualify as a FAQ?

Jim Marks Senior Market Analyst LodgeNet Entertainment Corporation

-----Original Message----- From: Roland van der Laak [mailto:rwvanderlaak@hotmail.com] Sent: Wednesday, September 10, 2003 3:57 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: using date in IF-statement

Hello Listers,

I'm trying to make an IF statement on a dateformat variabele , comparing it to a certain date.

I want the variable "dummy" to get the value 1 if "date" is before september first 2003, for instance:

IF (date < 01.09.2003) dummy=1. EXE.

(date has the (european) dd/mm/yy format, EDATE)

This, unfortunately, doesn't seem to work... ;-(

The only solution I found sofar, is instead of comparing the variable date to 01.09.2003 is comparing date to the value of 01.09.2003 in number of seconds since gregorian calendar (1582).

I assume there must be an easier way, as this is a syntaxjob I have to do twice a week, and the date needed in the IF statement changes daily...

Any help is much appreciated,

Roland van der Laak


Back to: Top of message | Previous page | Main SPSSX-L page