Focal Point
[SOLVED] CNT(FIELD1) IS NOT WORKING

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4231006013

December 15, 2008, 03:59 PM
Rekha
[SOLVED] CNT(FIELD1) IS NOT WORKING
Hi ,

This is a simple CNT on a field, it works fine on one table, but the same dont work on, on the other table. i dont know what is the problem. Anyones help is greatly appreciated.

here is the code sample :

TABLE FILE TABLE1
SUM
CNT.FIELD1
END

This is returing the code for the SQL as follows:

SELECT COUNT(*) FROM table1 as
T1;


i wanted the code to work like the below SQL Syntax:


SELECT COUNT(field1) FROM table1 as
T1;



Thanks
Rekha

This message has been edited. Last edited by: Kerry,


WebFocus 7.6.4
windows XP
MS SQL 2000/2005
December 15, 2008, 04:18 PM
Waz
Have you searched the forum for other posts on this subject.

There are many.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

December 15, 2008, 04:26 PM
Francis Mariani
Here are some:

Count of records
Mutliple Counts in a BY
Row Count


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
December 15, 2008, 05:08 PM
FrankDutch
very easy

TABLE FILE XYZ
COUNT field AS 'T1'
BY other field
END


But do follow the advices of search or follow the links from Francis....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

December 16, 2008, 03:39 PM
Rekha
Thanks every one for your suggestion.
I think i found the solution by myself.
It is the database field design, if the field is "Not Null", then it will work like below:

SELECT COUNT(*) FROM table1 as
T1;

if the field allows Nulls in the table then we can get the syntax like :

SELECT COUNT(field1) FROM table1 as
T1;

when you wrtite the code in webfocus like this :

TABLE FILE TABLE1
SUM
CNT.FIELD1
END

I hope this will help some one else.

thanks
Rekha


WebFocus 7.6.4
windows XP
MS SQL 2000/2005