weird stuff with dates in PH 7.10G1
Deskin, Bob
Bob.Deskin@Cognos.COM
Fri, 23 Apr 1999 09:39:17 -0400
The first problem, where you have a PIC on a date, should work. Report it as
a bug (it may be reported already). Try adding NUMERIC to the FIELD
statement after the item name. The PIC basically changes the type from date
to numeric. Normally you shouldn't have to specify NUMERIC.
On the second, using DATEEXTRACT is the recommended method. Try the ASCII
again with ,8 after the date. Also, try reporting it in QUIZ after equating
it to a numeric define. You may find that it's actually a 6 digit date
(century excluded), although the item may be century included. This is
something to watch for in Y2K conversions. Do this:
DEF x integer size 4 = date1
Rep date1 x
This shows you exactly what's in the item.
Bob Deskin
Senior Product Advisor, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 4205 FAX: (613) 228-3149
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA
-----Original Message-----
From: Robert J.M. Edis [mailto:robert.edis@creatcomp.com]
Sent: Friday, April 23, 1999 9:15 AM
To: 'powerh-l@lists.swau.edu'
Subject: weird stuff with dates in PH 7.10G1
G'day all
I was working on an issue for a client who had upgraded from 6.10e to 7.10g1
and discovered a couple of things.
In 6.n I could view the value of a date field in Quiz using REP mydate PIC
"^^^^^^^^" but in 7.10 I can't. In fact, 7.10g1 will give me a compile
error if a FIELD statement has a PICTURE clause with it in Qdesign. I can
live with these changes.
The other issue was a subscripting problem. A screen is doing a LET on a
TEMP item. This statement is creating a string that contains two dates.
Here is the syntax:
TEMP mystring CHAR*60
LET mystring = "This date is in MMDDYY format: (" + ASCII(date1)[5:3] &
+ "/" + ASCII(date1)[7:2] + "/" ASCII(date1)[3:2] + ")"
The value stored in date1 is 19990301 (PHD is century included).
The result was "This date is in MMDDYY format: (01/ /03)".
To get around this I created a separate DEFINE to get the date as a CHAR and
using DATEEXTRACT(). E.g.
DEFINE d_date1 CHAR*10 = "(" + ASCII(DATEEXTRACT(date1,MONTH),2) + "/" &
+ ASCII(DATEEXTRACT(date1,DAY),2) + "/" &
+ ASCII(DATEEXTRACT(date1,YEAR),4)[3:2] + ")"
LET mystring = "This date is in MMDDYY format: " + d_date1
The result now is "This date is in MMDDYY format: (03/01/99)", as it should
be.
Any ideas?
Blue
PowerHouse consultant
Rhode Island, USA
Disclaimer:
The opinions and ideas expressed in this message are my own and have no
relationship to my current employer, Initial Technical Staffing, its client
CCI, or any of CCI's clients.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.