|
-
Mar 9th, 2005, 01:52 AM
#1
Thread Starter
Lively Member
Data Manipulation
Hi i want to get records between 2 years month wise, order by month
which should show records like
total : thisdate
----------------
50 : may 01
60 : dec 01
50 : jan 02
etc.
im using this query but, i want if there is no data in any month within defined range it should show "0" in that month field.
at this time it is showing records which has only data in it.
select count(*) total, datename(month,[date]) as thisdate
from prof_midt
where [date] between '1/1/2003' and '2/1/2005'
group by ([date])
order by [date]
Adeel.
Last edited by adeelahmed; Mar 9th, 2005 at 03:43 AM.
Adeel Ahmed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|