Commit f6ec0afb authored by Stephane Crozat's avatar Stephane Crozat

Fix #23 use LPAD function and cast code to text, instead of manual CASe

parent f3da8246
......@@ -19,7 +19,7 @@ CREATE OR REPLACE VIEW vapi AS
SELECT
*,
TO_CHAR(dbegin,'TMday FMDD TMmonth') AS normdbegin,
CASE WHEN code<10 THEN '000'||code WHEN code>=10 THEN '00'||code END AS normcode,
LPAD(code::text, 4, '0') AS normcode,
TO_CHAR(dbegin + duration-1,'TMday FMDD TMmonth') AS normdend,
TO_CHAR(dbegin, 'IW') AS week,
TO_CHAR(dbegin, 'yyyy') AS year,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment