dbTalk Databases Forums  

Date Formatting

comp.databases.pick comp.databases.pick


Discuss Date Formatting in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scott Deardorff
 
Posts: n/a

Default Date Formatting - 01-16-2007 , 05:05 PM






I was looking for some help with output conversion codes, to see if there
was a simple way to output dates in YYYY-MM-DD format when using SORT or
LIST. CALLing a subroutine will probably be too slow for this particular
application.

Thanks,

Scott Deardorff



Reply With Quote
  #2  
Old   
Chandru Murthi
 
Posts: n/a

Default Re: Date Formatting - 01-16-2007 , 05:18 PM







0008 A;23(D/)]A;LPV(G2/1):'-':LPV(G0/1):'-':LPV(G1/1)

where 23 = your date attr; ] is @VM

LIST TKT.TEST ID.SUP F23 DTE 05:16:35pm 16 Jan 2007 PAGE 1
F23............ DTE.........

9141 1993-01-09
9020 1992-19-01

Chandru

"Scott Deardorff" <smdamd (AT) bellsouth (DOT) net> wrote

Quote:
I was looking for some help with output conversion codes, to see if there
was a simple way to output dates in YYYY-MM-DD format when using SORT or
LIST. CALLing a subroutine will probably be too slow for this particular
application.

Thanks,

Scott Deardorff




Reply With Quote
  #3  
Old   
infoattaloncsdotcomdotau
 
Posts: n/a

Default Re: Date Formatting - 01-16-2007 , 06:08 PM



Hi,

On Tue, 16 Jan 2007 17:05:11 -0600, "Scott Deardorff"
<smdamd (AT) bellsouth (DOT) net> wrote:

Quote:
I was looking for some help with output conversion codes, to see if there
was a simple way to output dates in YYYY-MM-DD format when using SORT or
LIST. CALLing a subroutine will probably be too slow for this particular
application.

I don;t know much about "proper Pick" but doesn't something like
D4-YMD[,2,] work there, too? Does in Universe, etc

Hope I've been of assistance

Jaye


Reply With Quote
  #4  
Old   
stefano
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 05:50 AM



Since D3/NT 7.5 and D3/Linux 7.4.2 (starting with patch A206??)
the LPV doesn't work anymore as in previous releases.

I propose this two variants:

1) Direct reference to the attribute 23

0008 A;23(D/)(G2/1):"-"23(D/)(G1/1)):"-"23(D/)(G0/1))


2) Direct reference to attribute 23 and SET-DATE-xxx independent

0008 F;23;(D4Y);"-";:;23;(DM);(MR%2);"-";:;:;23;(DD);(MR%2);:


Thanks,
Stefano


Chandru Murthi ha scritto:
Quote:
0008 A;23(D/)]A;LPV(G2/1):'-':LPV(G0/1):'-':LPV(G1/1)

where 23 = your date attr; ] is @VM

LIST TKT.TEST ID.SUP F23 DTE 05:16:35pm 16 Jan 2007 PAGE 1
F23............ DTE.........

9141 1993-01-09
9020 1992-19-01

Chandru

"Scott Deardorff" <smdamd (AT) bellsouth (DOT) net> wrote in message
news:nScrh.1711$3t4.1695 (AT) bignews2 (DOT) bellsouth.net...
I was looking for some help with output conversion codes, to see if there
was a simple way to output dates in YYYY-MM-DD format when using SORT or
LIST. CALLing a subroutine will probably be too slow for this particular
application.

Thanks,

Scott Deardorff




Reply With Quote
  #5  
Old   
Tom Phillips
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 06:50 AM



Stefano - major - major BUG!!!!
By any chance did you or yours report this to RD, and if so, what was their
response?
Curoius,
Tom

"stefano" <stefano (AT) friuldata (DOT) it> wrote

Quote:
Since D3/NT 7.5 and D3/Linux 7.4.2 (starting with patch A206??)
the LPV doesn't work anymore as in previous releases.

I propose this two variants:

1) Direct reference to the attribute 23

0008 A;23(D/)(G2/1):"-"23(D/)(G1/1)):"-"23(D/)(G0/1))


2) Direct reference to attribute 23 and SET-DATE-xxx independent

0008 F;23;(D4Y);"-";:;23;(DM);(MR%2);"-";:;:;23;(DD);(MR%2);:


Thanks,
Stefano


Chandru Murthi ha scritto:
0008 A;23(D/)]A;LPV(G2/1):'-':LPV(G0/1):'-':LPV(G1/1)

where 23 = your date attr; ] is @VM

LIST TKT.TEST ID.SUP F23 DTE 05:16:35pm 16 Jan 2007 PAGE 1
F23............ DTE.........

9141 1993-01-09
9020 1992-19-01

Chandru

"Scott Deardorff" <smdamd (AT) bellsouth (DOT) net> wrote in message
news:nScrh.1711$3t4.1695 (AT) bignews2 (DOT) bellsouth.net...
I was looking for some help with output conversion codes, to see if
there was a simple way to output dates in YYYY-MM-DD format when using
SORT or LIST. CALLing a subroutine will probably be too slow for this
particular application.

Thanks,

Scott Deardorff




Reply With Quote
  #6  
Old   
Ed Sheehan
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 07:44 AM



This works in Universe:

DYMD['-','-']

Ed

"Scott Deardorff" <smdamd (AT) bellsouth (DOT) net> wrote

Quote:
I was looking for some help with output conversion codes, to see if there
was a simple way to output dates in YYYY-MM-DD format when using SORT or
LIST. CALLing a subroutine will probably be too slow for this particular
application.

Thanks,

Scott Deardorff




Reply With Quote
  #7  
Old   
Scott Deardorff
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 09:02 AM



Thanks for all the replies. I tried most of the solutions, and went with a
modified version of Stefano's first suggestion.

008 A;23(D4/)(G2/1):"-"23(D4/)(G0/1)):"-"23(D4/)(G1/1))

Just had to flip the month and the day to get YYYY-MM-DD. Even though the
D/ was defaulting to a 4 digit year, I also changed it to D4/ for
consistency with our other standards.

Found this worked great with D3NT and D3 Linux.

Thanks again for the help!



Reply With Quote
  #8  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 12:23 PM



How about formatting the date with "-" instead of "/", then you can get
the mm-dd in one chunk with a single G0-2 instead of G0/1 + G1/1:

008 A;23(D4-)(G2-1):"-":23(D4-)(G0-2)

(Thats the big advantage of the G correlative vs the FIELD function.)

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

Scott Deardorff wrote:
Quote:
Thanks for all the replies. I tried most of the solutions, and went with a
modified version of Stefano's first suggestion.

008 A;23(D4/)(G2/1):"-"23(D4/)(G0/1)):"-"23(D4/)(G1/1))

Just had to flip the month and the day to get YYYY-MM-DD. Even though the
D/ was defaulting to a 4 digit year, I also changed it to D4/ for
consistency with our other standards.

Found this worked great with D3NT and D3 Linux.

Thanks again for the help!


Reply With Quote
  #9  
Old   
Chandru Murthi
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 03:40 PM




"Scott Ballinger" <scott.ballinger (AT) gmail (DOT) com> wrote

Quote:
How about formatting the date with "-" instead of "/", then you can get
the mm-dd in one chunk with a single G0-2 instead of G0/1 + G1/1:

008 A;23(D4-)(G2-1):"-":23(D4-)(G0-2)

(Thats the big advantage of the G correlative vs the FIELD function.)
Used to be. All FIELD functions have a chunk count as in x =
FIELD(string,'*',2,3)

C
Quote:
/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006

Scott Deardorff wrote:
Thanks for all the replies. I tried most of the solutions, and went with
a
modified version of Stefano's first suggestion.

008 A;23(D4/)(G2/1):"-"23(D4/)(G0/1)):"-"23(D4/)(G1/1))

Just had to flip the month and the day to get YYYY-MM-DD. Even though
the
D/ was defaulting to a 4 digit year, I also changed it to D4/ for
consistency with our other standards.

Found this worked great with D3NT and D3 Linux.

Thanks again for the help!




Reply With Quote
  #10  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: Date Formatting - 01-17-2007 , 05:37 PM



Didn't know that! But too bad the syntax is not the same as the G
correlative:

x = "aaa.bbb.ccc"
oconv(x,"g1.2") = bbb.ccc
field(x,".",1,2) = aaa.bbb

Actually, the field syntax ("starting with" vs. "skipping") is probably
more intuitive, but how many ways do we really need to skin this cat?

/Scott

Chandru Murthi wrote:
Quote:
Used to be. All FIELD functions have a chunk count as in x =
FIELD(string,'*',2,3)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.