SQLTeam.com | Weblogs | Forums

MS SQL QUERY to get Quarterly Data

Hello:

I have Sql table "Payroll" which have
PayrollID,PayrollDate,StoredID,EmpName,TotInc,StateTax, etc

I need Sql Query to give me following output'

StoreID, MonthName, StateTax

Example

Store Jan Feb Mar Apr........Dec
Store1 109 200 310 322

The value of the Statetax comes from Payroll Table

Please let me know if you have any questions.
Thanks.

Riz

Welcome @rizmomin

Please provide sample data for example

create table #Payroll(PayrollID int) ---etc
insert into #Payroll
select 1 --etc

Hello:

I am very sorry as I am new in this forum.
Is there a way i can send attachment of the table structure and my requirement?

Riz

No worries. Yes there is a way
By providing the DDL and DML as below. That way we can emulate your db on our local server

create table #Payroll(PayrollID int) ---etc
insert into #Payroll
select 1 --etc