September 19, 2008 at 3:02 am
Hello
Does anyone know how I can script in T-SQL a result similar to the attached excel template?
I just need a sample, not an actual script to put me in the right direction, so it can be:
select date, a,b,c from table
where a > 500
group by date
order by date asc
September 19, 2008 at 3:47 am
b_boy (9/19/2008)
HelloDoes anyone know how I can script in T-SQL a result similar to the attached excel template?
I just need a sample, not an actual script to put me in the right direction, so it can be:
select date, a,b,c from table
where a > 500
group by date
order by date asc
A case will be useful in such scenario. Consider the following example:
select count(orderid), sum(case when shipmentaddress <> billaddress then 1 else 0 end), sum(case when deleverydate = orderdate +1 then 1 else 0 end)
and so on.
September 19, 2008 at 4:14 am
arjun.tewari (9/19/2008)
sum(case when deleverydate = orderdate +1 then 1 else 0 end)
and so on.
This part of the query returned o as dates, or maybe there is something I dont uderstand, i have copied the query used for each column, in the attached spreadsheet, maybe that will help.
September 19, 2008 at 8:18 pm
If you want better help, please practice the methods and recommendations found in the link in my signature below.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 0 posts
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy