Skip to Content
0
Former Member
Aug 20, 2007 at 05:47 PM

How do I get "CO" variable 01 to 67 in character format?

12 Views

Post Author: Dennis Hernan

CA Forum: Data Connectivity and SQL

I have 2 databases. "DBA"."RMS_A0_SEGMENT" & "DBA"."RMS_G0_SEGMENT". The A0 segment has a CNTY variable. We create table B from A only to create SELYEAR & CO. SELYEAR is numeric because it is "2007 as". CO is numeric because it is "CNTY as". The values in CNTY are 1 to 67 numeric. How do I get "CO" variable 01 to 67 in character format?

Is this standard SQL or would you call it Crysal SQL format? Select "B"."CNTY", "B"."SR", "B"."SEG", "B"."FED_AID", "B"."TBK_CODE", "B"."PAVE_CYC", "B"."SURFACE", "B"."LENGTH", "B".SELYEAR, "C"."KEY_YEAR", "C"."SEG", "C"."SR", "C"."CNTY", "C"."SLDSTATU", "B"."CO" FROM (SELECT "A"."CNTY", "A"."SR", "A"."SEG", "A"."FED_AID", "A"."TBK_CODE", "A"."PAVE_CYC", "A"."SURFACE", "A"."LENGTH", 2007 as SELYEAR, CNTY as CO FROM "DBA"."RMS_A0_SEGMENT" "A") "B" LEFT JOIN "DBA"."RMS_G0_SEGMENT" "C" ON ("B"."SEG" = "C"."SEG") AND ("B"."SR" = "C"."SR") AND ("B"."CNTY" = "C"."CNTY") AND ("B".SELYEAR = "C"."KEY_YEAR")