Click here to Skip to main content
14,732,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI friends,,,,

I am counting total customers in a state using Subscription date in SQL SERVER 2000 or MSDE.
select state,count(*) as Total from custdetail where active='T' and convert(varchar(20),startdate,103) between convert(varchar(20),'1/12/2005',103) and convert(varchar(20),'1/12/2013',103) group by state

But not getting any result.

In database i can see the customers but in reports itz not coming.....
Updated 28-Mar-13 22:29pm
Sandeep Mewara 29-Mar-13 4:59am
Does your query run in SQL Query Window? Does it return anything?
PRAKASH_N 29-Mar-13 5:25am
nothing it returning
Mike Meinz 29-Mar-13 21:14pm
It looks like you are using varchar for date column comparisons. Dates should be in columns of type Date and compared values CAST as type Date or CONVERTed to type Date.

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