Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hye all..

I have stated a sql statement to select all data according to selected year by user. Let say user selects Year 2012. How can I display all bar for each month eventhough some months contain zero data?
Meaning that if in March, there is no transaction occurs, the bar graph would not skip the bar from February to April. It still show March in bar graph.

Tq for any help.
Posted

1 solution

You can change your query like this to print 0 if there is no or NULL data in the month.

SQL
SELECT ISNULL(columnname, 0) FROM MyTable


That should still hold a 0 in the March column.

Thanks
 
Share this answer
 
Comments
snamyna 23-Sep-12 20:49pm    
Thank you ShaikhM. I have taken into account your suggestion and it works but I changed a bit where I create a new datatable and assign any NULL value into 0 and it creates the bar for 0 values. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900