Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Xbase Fox > Re: Assignment ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 776 of 861
Post > Topic >>

Re: Assignment of date variables

by Gene Wirchenko <genew@[EMAIL PROTECTED] > Jun 5, 2007 at 05:38 PM

[reordered to chronological]

Josh Assing <XjoshX@[EMAIL PROTECTED]
> wrote:

>>On 3 Jun 2007 02:26:06 GMT, rlewart@[EMAIL PROTECTED]
 (Cass Lewart)
wrote:
>>
>>>Is there a direct assignment of dates like in Foxpro for DOS using
curly 
>>>brackets, e.g.  dt={02/02/2007} or do I have to use the CTOD function?
>>>
>>>dt=ctod("02/02/2007")

>On Sat, 02 Jun 2007 19:58:50 -0700, Josh Assing <XjoshX@[EMAIL PROTECTED]
>
wrote:
>
>>You can use the brackets only for a DATETIME vartype.  for DATE types
your
>>limited to ctod() or date()

>I'm sorry -- I wrote too quickly...

>x={^2005-2-2}
>?VARTYPE(x)
>
>returns D (date)
>
>so you can use hte brackets, ctod() or date()  -- I prefer the date()
method as
>I think it's easier to read.

     I do not use absolute dates very much in my app, and most of my
manipulations are relative so I use thedate +/- number or gomonth().

     I have a few cases where I build the string representation of a
date from a date.  It is more awkward to break up the date into year,
month, and day, so I use dtoc() then to build a date delimited with
"{^" and "}".  (If you do this, remember to set date ansi first and to
set the setting back after.)

     If you have the pieces of the date already, then
date(theyear,themonth,theday) would be the easier approach.  Beware,
however of passing date() a bad date.  If a parameter is obviously
wrong (e.g. the 32nd of a month or the 13th month), an error is
thrown, but if a parameter is wrong by association with the other
parameters (e.g. April 31st), an empty date is returned.  (This
behaviour is in VFP 9 SP 1 and VFP 6 SP 5 (and presumably the rest of
them.))

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
     I have preferences.
     You have biases.
     He/She has prejudices.
 




 6 Posts in Topic:
Assignment of date variables
rlewart@[EMAIL PROTECTED]  2007-06-03 02:26:06 
Re: Assignment of date variables
Josh Assing <XjoshX@[E  2007-06-02 19:58:50 
Re: Assignment of date variables
Josh Assing <XjoshX@[E  2007-06-02 20:01:59 
Re: Assignment of date variables
Gene Wirchenko <genew@  2007-06-05 17:38:03 
Re: Assignment of date variables
rlewart@[EMAIL PROTECTED]  2007-06-03 20:09:55 
Re: Assignment of date variables
tim_witort@[EMAIL PROTECT  2007-06-04 11:58:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:32:54 CST 2008.