Log in Register FAQ Memberlist Search ContactReview Forum Index
A GoldMine Discussion and Support Community

ContactReview Forum Index » GoldBox » converting a character date
Post new topic  Reply to topic View previous topic :: View next topic 
converting a character date
PostPosted: Mon Mar 03, 2008 11:06 pm Points: 0 Reply with quote
unaclancy
GoldMine Journeyman
Joined: 29 Oct 2007
Posts: 32




Hello,

I wonder if anyone could help me with a date conversion question please? I am importing from a date field which is given to me in the format of 29th of March, 2008. I have tried to convert it using CTOD but it shows the result as \ \ \.

Any help would be greatfully welcomed
Thanks
Una
View user's profile Send private message

PostPosted: Tue Mar 04, 2008 5:11 am Points: 0 Reply with quote
BobTaylor
GoldBox Guru
Joined: 07 Sep 2007
Posts: 1216
Location: Jacksonville, FL




If you will do a TEMPORARY mapping of any Character Type field to any Date Type in any GoldBox Import, you will get the list of "Date Masks" that GoldBox is designed to handle. And you will find that the "date format" that you have been given does not exist in that list.

Furthermore, the Help Article below describes all the date conversions that can be accomplished using the GoldBox function RealDate(). Again, the function cannot accept the "date format" you have been given (although it is capable of producing it as a Character Type Output).

This causes me to conclude that what you have been given is not actually data; I think you have been given prose masquerading as data. GoldBox simply can't deal with it. You may want to check with Dave Petonic and see if he is willing/able to consider adding what you have to GoldBox.
_________________________
FUNCTION / RealDate()

Description:
Translates a passed in value to another date format. There are 21 possible returns.


Param 1 (reqd):
The date value (Literal, or dBase Field Name) as either a STRING or a DATE.
Param 2 (reqd):
The Code Number of the format you wish to be returned.
Param 3 (opt):
Any value, such as the number 3. Used (optionally) only for Value 19, see below.


Returns:
A translation of the Param 1 date value, based on the value of the 2nd parameter.

Example:
The following assumes Wednesday, February 16th, 2005 as the example date.

Wherever the CtoD() function is used below as the 1st parameter - this indicates passing in a TRUE dBase date value. In your operations, typically this will be a Field Name. Please ensure the Field Type is D for Date. Example: RealDate(Contact2->UBirthday, 21)

Wherever a literal string is used below as the 1st parameter - this indicates passing in a CHARACTER type entry. In your operations, typically this will be a Field Name. Please ensure the Field Type is C for Character. Example: RealDate(SubStr(Contsupp->City, 9, Cool, 9)

The letter following the call to RealDate() below indicates the data TYPE returned:
{C} = CHARACTER or STRING
{D} = DATE
{N} = NUMERIC

Code:
RealDate(CtoD("02/16/2005"),  1)   {C} Wednesday, February 16, 2005
RealDate(CtoD("02/16/2005"),  2)   {C} Feb 16, 2005
RealDate(CtoD("02/16/2005"),  3)   {C} February 2005
RealDate(CtoD("02/16/2005"),  4)   {N} 47th Day of Yr (Julian date)

RealDate(CtoD("02/16/2005"),  5)   {C} February 16, 2005
RealDate(CtoD("02/16/2005"),  6)   {C} February 16
RealDate(CtoD("02/16/2005"),  7)   {C} 021605
RealDate("050216",  8)         {D} 02/16/2005
RealDate("20050216",  9)      {D} 02/16/2005
RealDate(CtoD("02/16/2005"), 10)   {C} FEB 16th
RealDate(CtoD("02/16/2005"), 11)   {C} FEB 16,05
RealDate("16-Feb-05", 12)      {D} 02/16/2005

RealDate("05-02-16", 13)      {D} 02/16/2005
RealDate("February 16 2005", 14)   {D} 02/16/2005
RealDate("16th February '05", 15)   {D} 02/16/2005
RealDate("16022005", 16)      {D} 02/16/2005
RealDate("160205", 17)         {D} 02/16/2005
RealDate(CtoD("02/16/2005"), 18)   {C} 050216
RealDate(CtoD("02/16/2005"), 19)   {C} Wednesday, February 16th
RealDate(CtoD("02/16/2005"), 19, 3)   {C} Wednesday, February the 16th

RealDate("2005-02-16", 20)      {D} 02/16/2005
RealDate(CtoD("02/16/2005"), 21)   {N} 165 (Number of Days until Birthday)
RealDate(CtoD("02/16/2005"), 22)   {C} 16th day of February, 2005

_________________
Bob Taylor
Bob Taylor Consulting
(904)646-9861
www.goldboxbob.com
Consulting with GoldBox and GoldMine since 1997.
View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Mar 04, 2008 5:09 pm Points: 0 Reply with quote
unaclancy
GoldMine Journeyman
Joined: 29 Oct 2007
Posts: 32




Thank you Bob for the reply.

Much appreciated
Una
View user's profile Send private message

converting a character date
  ContactReview Forum Index » GoldBox
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic  


Brought to you by Castell Computers, Doug Castell, Admin
RSS Feed
Powered by phpBB © 2001-2004 phpBB Group
Theme created by Vjacheslav Trushkin