Can I add a datetime filter to an expression in SSRS

I am using SSRS to create a tablix that displays weekly, monthly and yearly values. My query contains data for the entire year. I would like to avoid creating 3 Datasets and then displaying three tables together (which I have already tried and did not like 
because occasionally the current week or month does not have the same number of rows in the Tablix. )
I am trying to create an expression that shows the Sum of the values
Sum(Fields!Sale.Value)
when the sales are equal  to the current week, month or year
DATEPART(wk, sale_date) IN (DATEPART(wk, @week)
DATEPART(month, sale_date) IN (DATEPART(month, @week)
DATEPART (year, sale_date) IN (DATEPART(year, @week)
Any ideas?

Hi PrandyJosselyn,
Per my understanding that you have an date field in table(Sale_date) and you want need to calculate the week sales, month sales, year sales based on this date, you need to filter the data of the yearly, monthly, weekly to display in the report based on the
filter, right?
I have testedon my local environment and you can modify the query in the main dataset as below to get add the week number, month number, year number if they didn't exists in the db, create three cacading parameter to display the values of "Year Number","Month
Number","Week Number".
Details steps below for your reference:
1.Modify the query in the main dataset as below to add the filter of the three parameters:
SELECT  Sale, Sale_Date, DATEPART(wk, Sale_Date) AS weeknum,DATEPART(month, Sale_Date) as monnum,DATEPART (year, Sale_Date) as yearnum
FROM   tablename
where DATEPART(year, Sale_Date) =(@YearNum) and  DATEPART(month, Sale_Date) =(@MonNum) and DATEPART(wk, Sale_Date) =(@WeekNum)
2.Create and new DateSet2 and create Parameter1(YearNum) which get the values from this dataset and use this expression:
SELECT     DATEPART(year, Sale_Date) AS YearNum
FROM         TableName
3.Create and new DateSet2and  create the Parameter2(MonthNum) get the values from this dataset and use this expression:
SELECT    Distinct  DATEPART(month, Sale_Date) AS MonthNum
FROM         TableName
where   (DATEPART(year, Sale_Date) = @YearNum)
4.Create and new DateSet3 and  create the Parameter3(WeekNum) get the values from this dataset and use this expression:
SELECT    Distinct  DATEPART(wk, Sale_Date) AS WeekNum
FROM         TableName
where   (DATEPART(year, Sale_Date) = @YearNum) and (DATEPART(month, Sale_Date) = @MonthNum)
5.Design the report to add group for the year and month:
If you still have problem, please provide the sample data of the table in DB and the snapshot of the report structure you have designed. 
Any problem, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • Can't Add To Access Control List Airport Express

    We have both Airport Extreme (2) and Express Base Stations (3) to create a wireless network. On the Extremes I can click the Add button in Access Control in the Airport Admin Utility to add people to the list. On all the Express Base Staions I can edit or delete entries already on the list but can't add any new ones. I can export an Access Control List but not import one. The button is greyed out only the button works. I could add to the lists in the past and I'm not sure when it stopped working. The network structure and settings have not changed. Has anyone heard of this problem?
    Aiport Express   Mac OS X (10.4.8)  

    WDS is used on two Express units to relay the signal from the main base station but not on third one which is connected directly to the network via ethernet.
    On the internet connected Express the Airport Network setting is:
    Wireless Mode: Create a Wireless Network (Home Router)
    All base stations have the same name to allow roaming.
    Internet is connected using Ethernet.

  • How can I add a search filter by EAN (code of items) in my application?

    I have to filter my list of item (product) by their code. Someone can eplain me how can i do it? I'm new with CF. Thanks.

    I think you need to be more specific about what you are trying to do.  When you say "filter my list..." do you mean in a database query, in a full-text search, or do you mean filter a displayed list based on some user interaction?

  • Can You Add The Widescreen Filter Without Stretching Video In iDVD ?

    I'm sure I have asked this in the past but cannot find the answer and my memory is lousy!
    I have added the Widescreen Filter to all the clips in a normal 4:3 DV sequence and everything looks OK.
    I export the QT Movie and when viewed in QT Player it still looks OK as a letterboxed 4:3.
    However, when I import it into iDVD or DVDSP I cannot stop it from being ridiculously stretched.
    I have tried setting projects as 4:3 and 16:9 in iDVD but the video always appears in the preview window badly stretched.
    Is it possible to make it appear as 16:9 without distorting the image?

    Would you Adam and Eve it !
    It was less than 8 weeks ago I was saying how it worked perfectly!!!!!
    http://discussions.apple.com/thread.jspa?messageID=8207730&#8207730
    However, now when I preview a movie (with the WS filter) in iDVD (or Simulate it in DVDSP) the image receives extra stretching.
    Is it just that it normally appears like that in the preview but will play OK when burned to a DVD ?

  • How can I add new software instruments to Logic Express?

    I just got Logic Express 8 and was disappointed to see that there were not as many instruments available as I thought there were. Is there a way I can add additional software instruments to my library without having to spend 300 more dollars to get Logic Studio?

    Hi,
    the cheapest way would be to buy a specific sample library from a music store and import them into the EXS24 Sampler. There are also some free downloadable ones, but i think they are not very satifactory.
    Maybe a Jam Pack would help, also. Don't have one myself, so this is a shot in the dark.
    However, i would encourage you to think about logic pro. You don't only get the sound library, but some very useful tools and plugins that Express doesn't contain. If i had the money, i would instantly go for it.
    Fox

  • Can I add airport extreme(n) to my express network

    I have a home network set up this way. Verizon DSL, Airport Express hooked up as main wireless router in my living room. I bought the new Airport extreme to put in my office where I have a computer with a printer and external hard drive, but there is no phone jack/dsl modem in that room. I want to add the Extreme to my current network, so all computers in the house can print and share the external harddrive I have ready to set up. I tried to add it multiple times last night, but it won't. I finds it briefly and then the extreme goes back to blinking yellow light.... Does the Extreme need to be the one hooked up the the LAN line? or can I have the Express be the main station? Thanks -doug
    iMac20 intel duo   Mac OS X (10.4.8)  

    I did all this and still having trouble with setup. It seems the airport setup software that came with the iMac lets you configure alot more than the software ont he disk that came with the Airport Extreme. yet the software that came with the iMac says it isn't compatible with the new Extreme. I changed setting on my express to be WDS but still can't join the two. The iMac likes to awknowledge only one at a time. Next i'm considering conecting both the the dsl and setting up two networks and joining them. After both are connected, unplug the extreme and see it is still networks with the expres.. what do you think?
    iMac20 intel duo Mac OS X (10.4.8)

  • Can't add datasource for local SQL Server Express

    I can't get new datasource to connect to a local SQL Server Express (2008).
    On SSE, I enabled non-NTLM authentication, created an account specifically for CFServer, and was able to log into SQL Server through Management Studio. But the datasource still won't connect.
    When I enter computerName/SQLServerName for the Server, I get a message saying "...The requested instance is either invalid or not running."
    When I enter just SQLServerName, message says "Error establishing socket. Unknown host: SQLServerName."
    When I enter (local), I get a message saying "Error establishing socket. Unknown host: (local)"
    When I enter 127.0.0.1, message says "Error establishing socket to host and port: 127.0.0.1:1433. Reason: Connection refused: connect"
    I don't know why the first is considered invalid, or why the fourth is refusing connection. Am I forgetting something?

    I found the solution, which doesn't have to do with Coldfusion, but rather with configuring SQL Server for TCP/IP.  In case someone else ever stumbles upon this post with a similar problem, I wrote about it at http://forums.devshed.com/ms-sql-development-95/trying-to-connect-to-sql-server-on-localho st-1433t-958558.html.

  • How to Add a Servlet Filter to Reports 11.1.1.2.0

    I am running Fusion Middleware 11g (Weblogic 10.3.2), with Oracle Forms/Reports 11.1.1.2.0. The installation is running the default managed servers WLS_FORMS and WLS_REPORTS.
    How can I add a Servlet Filter to the Reports 11.1.1.2.0 application which is running under the WLS_REPORTS managed server?
    I have read the Oracle Doc ID: 418366.1, which describes a process for adding a servlet filter to Reports Developer 10.1.2.2, but I am unclear as to which web.xml file I need to modify in weblogic and where to place the class file for the servlet filter.
    Thanks in advance for your help.

    I can provide some partial help.
    The set up I have was running it locally on Windows 7 (64 bit) laptop and running the reports server (version 11.1.1.4) in XP Mode as part of Windows 7 Professional.
    To find which web.xml file to change, I searched the directories for web.xml and then removed then renamed the web.xml files to something else to see which impacted the start up of the reports server.
    It turns out it was a web.xml file in web.war file in the following directory which impacted the start up:
    C:\Oracle\Middleware\user_projects\domains\ClassicDomain\servers\WLS_REPORTS\tmp\_WL_user\reports_11.1.1.2.0\1ww4ab
    So used winzip to extract files, update web.xml file and and java class as a jar file in the WEB-INF\lib directory and zipped back up to a web.war and put it in the above directory and restarted the Reports Server.
    Note the url pattern I used was slightly different to that shown in the oracle note (forward slash before asterix):
    <url-pattern>/rwservlet/*</url-pattern>
    Have not investigated how to do in for a production environment, but hopefully this information is of use.
    Les.

  • Project Server 2010:- How to add Own Workspace filter in workspace web part like project server 2007

    Hi All,
    I am using project server 2010.
    Can some one advise me how can I add Own Workspace filter option in workspace web part like project server 2007 which is showing all projects name page by page. There no filter option available. I am not sure if there is any out of box feature. 
    Thanks in Advance..

    Nitin,
    PS2010 shows by default the workspaces you have permissions to. Unfortunately, there is no more filtering options available.
    The only solutions are to write a custom webpart, or develop your own SSRS Report, which you can customize the way you want.
    Refer to Paul's excellent blog post on this topic here:
    http://pwmather.wordpress.com/2011/08/05/custom-projectserver-project-site-workspace-view-in-pwa-ps2010-ps2007-epm-msproject-ssrs/
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:

  • When I add a photo filter to an image, I can't use the color sampler in the photo filter dialog box. It automatically selects white. What am I doing wrong?

    Whenever I add a photo filter to an image, I can't use the sampler tool that automatically appears when you open the photo filter dialog box to manually select the color of your filter. Whenever I try to use it, it automatically selects white (#ffffff), no matter where I click in the image. Does anyone know what I'm doing wrong?
    Thanks

    When you add an adjustment layer, the layer mask is automatically active. You need to activate the pixel (image) layer by clicking on it in the Layers panel.

  • How can ew add filter in Dataset of MDX Query

    Hi,
    I am working on TFS 2010 Report with Report Builder 3.0
    I need to fetch data on basis of Start Task Date(means when user start their task).
    So i have added a new field in a TFS Work Item Template with name StartTaskDate.
    Now i need to fetch the report FromTaskDate to TOTaskDate(Date Range Filter).
    so how can we do this with filter option?
    Can any body help me on this.
    Thanks

    Hi rohitnegi09,
    If you want @FromTaskDate and @TOTaskDate parameters are Date/Time data types, please refer to my last reply in the following thread:
    http://social.technet.microsoft.com/Forums/en-US/db75abb9-2250-463a-8ef3-70426f617329/mdx-report-on-date-range?forum=sqlreportingservices
    If you want @FromTaskDate and @TOTaskDate parameters are Text data types, we can directly type the following MDX query in the dataset:
    select
    {[Measures].[Internet Sales Amount]
    } on columns,
    {[Date].[Date].members} on rows
    from(
    select
    STRTOMEMBER("[Date].[Date].&["+@FromTaskDate+"]"):STRTOMEMBER("[Date].[Date].&["+@ToTaskDate+"]")
    ) on columns
    from [Adventure Works]
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How can I add vocal effects other than the 9 Voice options? (I can't shift pitch)

    Hello!
    I am making the switch from PC and am just trying to lower the pitch of a vocal track by at least an octave; I just got a MBP last week and am running GB 10.0.2. I can't find any info on similar problems that is helpful; most solutions I've come across show that when the track is selected, there should be a pitch shift bar with a sliding button, but I do not have that. I read a lot of people saying something about the track being purple or not, but I'm not sure if that's relative to the version I have or if that has anything to do with what's happening. When I select the track, in the little area toward the lower left when "Track" is selected, (what is that space called?) where the pitch shift option is for other people, I only have a sliding bar for Pitch Correction, and a checkbox for Limit to Key and Enable Flex. When "Region" is selected, it just shows the name of the region and there are no options. Another question I have is how to change the pitch of midi sounds? When the keyboard is open on the screen I have tried moving the little octave shifter, but it assigns the sounds that are on the keyboard at different locations if I move it, so it changes the sound completely. A couple of them shift one octave up or down, but there are no actual controls..
    I'm mostly just dabbling with EDM/trap/Hiphop tracks at the moment, but am confused about whether or not there are other vocal effects and controls other than the preset Voice options in the instrument area (Bright vocal, Classic vocal, compressed vocal, Edge vocal, etc.)? I'm not going to be using GB forever, but are there not any other options like for current rap/trap production (phaser, balance, EQ, auto tune, choppers, actual voice altering effects, etc.) [preferably without buying extra things]? And not only vocals, but editing effects for all sounds.. If so, how do I get to them? And if not I know I should at least be able to lower or raise the pitch of a vocal recording... There are some pretty legit electronic instruments that are exactly the kind of sound I'm going for so I was surprised to not see an equally simple to access vocal effects board or something. Any additional tips for a n00b electronic music producer would also be greatly appreciated! Thank you for any help!

    In GarageBand 10 you can no longer change a track with an audio file to a "purple" audio recording, as it has been possible in GarageBand '11.
    Even, if you can make the transpose slider visible by enlarging the the track editor panel, the slider will be disabled.
    What you can do however, is either add an AuPItch filter  from the audioUnit panel or to convert your audio file to loop and to admit from the Loop Browser.
    In the new GarageBand you add the AuPitch filter from the Smart Controls.
    Enlarge the SmartControl panel by dragging the dividing line upwards, until you see the Audio Units brick, then add an Apple Audio Unit and set it to AuPitch.
    Or create a loop from the audio file. Select the region in the track and use the command "File: Add region to Loop library". You need to trim the filet an exact number of measures.
    Set the current key and tempo, name the loop, and save the loop. Make sure, that one-shot loop is not enabled.
    Now add it from the loop browser to a new track and delete your old track. The search field in the Loop browser will help you to find the loop quickly.
    You will be able to transpose the sample  like any regular loop.

  • Can I add a lossless file to my itunes library?

    Can i add a lossless music file to my itunes library? Usually what i do is drag the file or folder into music/itunes/itunes media/automatically add to itunes and it works fine, everything shows in my library and plays perfectly. But with this lossless file i drag it into the automatically add to itunes folder and it goes into the folder but doesnt show up in itunes. I think i know that itunes doesn't support lossless files, so can somene tell me how to convert them into apple lossless or MP3s (preferably apple lossless). Please help.

    The are a variety of different lossless audio formats, some supported by iTunes, some partially supported and some not at all.
    The best lossless audio format to use from an iTunes point of view is Apple Lossless aka. ALAC. iTunes can import (rip) audio CDs using this format. Other lossless formats supported by iTunes include WAV (partially) and AIFF, however these formats use more disk space than Apple Lossless and do not sound any better, and further more do not support meta-tags as well as Apple Lossless.
    Another lossless format you may hear of is FLAC, iTunes does not support this format but it can be otherwise considered equivalent to Apple Lossless in file size and capability. You can convert FLAC to Apple Lossless with of course no loss of quality but you will need to use another utility to do the conversion.
    There is also WMA Lossless, this is not supported for playing by iTunes but I believe can be imported (only in iTunes for Windows, not Mac).
    So, contrary to your message, yes iTunes does support lossless audio files.
    For what its worth I have all mine in Apple Lossless and share it with Windows Media Player and Microsoft Media Center which can also play Apple Lossless (with an additional free directshow filter).
    Note: Music purchased from the iTunes store will all be in AAC format which is a lossey format.

  • How can I change a Mixer filter in real-time? (11.5)

    Hi all,
    I'm currently coding (or trying to code) an interactive soundboard that users can play with in their software. They can turn inputs on and off, increase the volume, change the EQ, etc. The nice is, and I was really pleased to discover this, Director already has a feature called an 'Audio Mixer' that has filters to satisfy all these functionalities! The bad thing, I can't figure out how to change these filters in real time.
    For example, here's the code to MUTE a specific mixer (activated when the user toggles a button):
    member("channelOneMix").mute()
    But how do I tell it go INTO that mixer, find the existing High Pass Filter, and change the value of that High Pass Filter's 'highCutOffFreq' property? It's a classic case of knowing exactly what I need to tell the code to do, but I have no idea of the SYNTAX of actually telling it to do that.
    I hate to be 'that guy', but it is somewhat urgent. This is for a college assignment due Wednesday (yikes!). I didn't quite know what I was getting myself into with this code, but the end is in sight if I can figure out how to write this particular code.
    Many gratuitous thanks in advance for any assistance!
    PS: It won't be enough to simply add a new filter to the list. The user needs to be able to turn a dial up or down to increase or decrease the High Pass Filter, in conjunction with several other dials manipulating other filters. I need to be able to actually change what the filter's value is.

    Thanks for your help!
    The problem is that I think that I changed the "default" name for the state where the photos were taken. I have 50 differents locations, that are all correct, and photo per photo, I can modify the original location, but only at "local" level.
    How can I change the name displayed in State section as "Casa David i Mireia" for "Catalunya" that is the real name for the State where the photos where taken?
    I don't if this post is comprehensive. I'm not sure.
    Thanks for your time!
    Jordi

Maybe you are looking for