That worked like a champ. I would like to take it one step further. I would like this to be a conditional statement.
IF CLAIM<>0 then alltrim(str(claim))+'-'+padl(clmsub,2,0) as claimno if not I would like to leave then result field blank
3000100-00
<blank>
11125-01
11256-00
How do I work this into the program:
Open database k:\vfp98\mrcdata
Create sql view 650TYVIEW AS;
Select Ledger.pc, Ledger.uw, Contracts.ctrsts AS COMMUTED, Ledger.dev, Ledger.bookyr,;
alltrim(STR(Ledger.claim))+"-"+ padl(Ledger.clmsub,2,'0')AS CLMNO,;
sum(Ledger.osloss)AS OSLOS, sum(Ledger.osexp)AS osexp,;
sum(Ledger.lospd+ Ledger.lossalv+ Ledger.losded+ Ledger.lossir)AS PDLOS,;
sum(Ledger.exppd)AS PDEXP, Contracts.subcls, Ledger.class;
FROM mrcdata!Ledger LEFT OUTER JOIN mrcdata!Contracts ;
ON Ledger.uw = Contracts.uw;
AND Ledger.class = Contracts.class;
AND Ledger.ctrpoolno = Contracts.ctrpoolno;
AND Ledger.subletr = Contracts.subletr;
WHERE Ledger.pc IN ("TY","OT"

;
AND Contracts.contract NOT IN ("OT 50239","OT 50399","OT 50289",;
"OT 50299","OT 50239","OT 50549","OT 50279","OT 50079","OT 50229"

;
AND Contracts.contract NOT BETWEEN "OT 50999" AND "OT 51029Z";
AND Contracts.contract NOT BETWEEN "OT 50060" AND "OT 50069Z";
AND Ledger.bookper <= ?'Booking Period (YYYYMM)';
AND Ledger.class <>" ";
GROUP BY Ledger.pc, Ledger.uw, Contracts.ctrsts, Ledger.dev,;
Ledger.bookyr, Ledger.claim, Ledger.clmsub, Contracts.subcls;
ORDER BY Ledger.pc, Ledger.uw, Contracts.ctrsts, Ledger.dev,;
Ledger.bookyr, Ledger.claim, Ledger.clmsub, Contracts.subcls
Use 650tYVIEW
Copy to k:\apps\alpha4v6\650tmty.dbf type foxplus