Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

SQL Query

$
0
0
I have the following query: SELECT Sales_Intrastat.SalesID, Sales_Intrastat.Year, Sales_Intrastat.Period, Sales_Intrastat.Sales, Sales_Intrastat.CostOfSales, InstrastatCustomers.Depot, InstrastatCustomers.AccountName, InstrastatCustomers.CountryCode, InstrastatCustomers.AccountNumber, CountryCode.Description, InstrastatCustomers.ContractCodeFROM Sales_Intrastat INNER JOIN InstrastatCustomers ON InstrastatCustomers.AccountNumber = Sales_Intrastat.AccountNumber INNER JOIN CountryCode ON CountryCode.CountryCode = InstrastatCustomers.CountryCodeWHERE (Sales_Intrastat.Period IN (@Period)) AND (InstrastatCustomers.Depot IN (@Depot)) AND (Sales_Intrastat.Year IN (@Year)) AND (InstrastatCustomers.CountryCode IN (@CountryCode))I want to create a new query to retrieve the results in this manner:Between Year and Period TO Year and PeriodMy current report has dropdowns where the user can:Select a Year and then Select a Period. So my new Report will have the Parameters Select a Year Select a Perioid Select a Year Select a PeroidCan anyone give me an idea of how to write the new query. I tried using a BETWEEN in two sets of Year and Period and this would work.

Viewing all articles
Browse latest Browse all 2791

Trending Articles