Hello,

if you have a string as Date="yyyy/mm/dd" then for MM/DD/YYYY use
    mid$(Date,6,2)+"/"+right$(Date,2)+"/"+left$(Date,4)
for MM/DD/YY use
    mid$(Date,6,2)+"/"+right$(Date,2)+"/"+mid$(Date,3,2)

if you have a MapInfo Date variable/field the use Str$(Date_Col) to get the
system short date
this converts YYYYMMDD to MM/DD/YYYY for my system

All information system store dates either as "yyyymmddhhnnss" or as
"dddddd.hhhhhh"
The first being in dBase as alot of other IS software and the second
is # or days since something Delphi uses 1/1/1900 and M$ Dos uses 1/1/1980
with the
hhhhh as the time expressed as fraction of 24 hours -- .25=6am, .5=noon,
.75=6pm

These are the only methods that will result in a properly sorted date
Otherwise for long-dates you get
April 1, April 12....April 2, April 20...April 3, April 30, August....., Feb
...., Mar,....Jul....,Jun
and short-dates
01/01/1999, 01/01/2000, 01/01/2001, 01/02/1999, 01/02/2000........






Trey Pattillo
-97.665333W 27.799121N
www.wap3.com
[EMAIL PROTECTED]


----- Original Message -----
From: "Anitra Robertson" <[EMAIL PROTECTED]>
To: "Windeler, David" <[EMAIL PROTECTED]>
Cc: "'MapInfo-L (E-mail)" <[EMAIL PROTECTED]>
Sent: Sunday, July 22, 2001 19:32
Subject: Re: MI-L re StringToDate function


>
>
> David,
>
> It must have been the day for that problem. I had exactly the same problem
on
> Friday - I tried the StringToDate function plus the NumberToDate Function
etc
> etc. The only thing I did find after lots of elimination and retry (and
> uttering expletives) was that the functions would not work when there were
> other pieces of information in the label (I am assuming you ARE talking
about
> labels).
>
> For example, I wanted to label objects by Name and then by Date, with the
> string: ProperName(Venue_Name) + Chr$(13) + "Expiry Date: " + Date (or
close to
> this). In this format, the label would work, but not give me the date in
the
> date format as it was shown in the browser. It would however, give me a
string,
> which was recognisable as a date, but not what I wanted to present to the
end
> users.
>
> In the end, I found a couple of "dirty" ways around this. One was to have
two
> seperate layers (as those without dates kept giving me an error -
"argument has
> invalid type"), and I changed the date format in the browser to a string
and
> then only labeled using the StringToDate on one layer, and the Name on
another
> layer. It was not the way I wanted to solve the problem, but the only way
I
> could see it would work. (I am open to anyother suggestions if you hear of
> them)
>
> I hope this helps.
>
> --
> Anitra Robertson
> GIS Analyst
> Tattersall's
> (Gaming and Lotteries)
> Melbourne, Australia
>
>
> CONFIDENTIALITY NOTE:
>
> This e-mail is intended only for the use of the individual or entity
> named above and may contain information that is confidential and
> privileged.  If you are not the intended recipient, you are hereby
> notified that any distribution, copying or dissemination of this
> e-mail is strictly prohibited.  If you have received this e-mail in
> error or are not the named recipient, please notify us immediately
> by return e-mail <[EMAIL PROTECTED]> or telephone
> 613-8517-7405 and destroy the original message.  Thank you.
>
>
> "Windeler, David" wrote:
>
> > This message is in MIME format. Since your mail reader does not
understand
> > this format, some or all of this message may not be legible.
> >
> > To whom it may concern:
> >
> > I am trying to use the StringToDate function to convert the date I have
> > stored as a string in YYYY/MM/DD format to a date. However, the function
> > will not allow me to do so. I have already tried setting the date format
to
> > "Local" but that doesn't seem to work. Does anyone know how I can
convert
> > the strings to a date?
> >
> > David Windeler Hons. BSc. Geo, GIS Apps. Specialist
> > GIS Technician
> > City Of Vaughan
> >
> > Engineering Department
> > 2141 Major Mackenzie Drive
> > Vaughan, Ontario
> > L6A 1T1
> >
> > Tel. (905) 832-8525 Ext. 8747
> > Fax (905) 832-6145
> > E-mail [EMAIL PROTECTED]
> >
> > _______________________________________________________________________
> > List hosting provided by Directions Magazine | www.directionsmag.com |
> > To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> > put "unsubscribe MapInfo-L" in the message body.
>
>
>
>
>
>
> _______________________________________________________________________
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, send e-mail to [EMAIL PROTECTED] and
> put "unsubscribe MapInfo-L" in the message body.



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to