Not sure what showcase is. But in sql you could do
With cte as (
Select a.*,
Case when dec(substring(digits(mydate), 5, 2),2,0) >= 10 then dec(substring(digits(mydate), 1, 4), 4, 0) + 1
Else dec(substring(digits(mydate), 1, 4), 4, 0)
END as MYYEAR
FROM MYFILE A
)
Select MYYEAR, ... from cte group by MYYEAR
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Friday, September 16, 2011 1:43 PM
To: Midrange Systems Technical Discussion
Subject: Showcase Date Handling
Anyone know how I would do this from Showcase:
GROUP BY
CASE
WHEN MONTH ( DATE ( MYDATE, YYYYMMDD ) ) >= 10 THEN YEAR ( DATE (
MYDATE, YYYYMMDD ) ) + 1
ELSE YEAR ( DATE ( MYDATE, YYYYMMDD ) )
END
in standard SQL? MYDATE is an 8.0 numeric field containing a date like 20110916.
Thanks!
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-l.
________________________________
Notice from Bob Evans Farms, Inc: This e-mail message, including any attachments, may contain confidential information that is intended only for the person or entity to which it is addressed. Any unauthorized review, use, disclosure or distribution is strictly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.
As an Amazon Associate we earn from qualifying purchases.