Fetch records in the last 12 months

Hi All,
I have an activity metrix field which returns the total number of completed activities for an account. My requirement is , I need only the total number of activities completed in the last 12 months from today.
So if a user views the same report after 3 months then it should display the list of completed activities in the last 12 months from that day.
Please suggest how to go about adding this filter.
Column Name - "Activity Metrics"."# of Closed Activities"
So I need COUNT("Activity Metrics"."# of Closed Activities") in the last 12 months...Please suggest how to get this expression.
Thanks
Natraj

Hi,
If your intention is to find out number of closed opportunities among activities created in last 12 months, a filter on created data like below can help
Activity."Created Date" >= TimestampAdd(SQL_TSI_MONTH,-12,Current_Date)
You have to use under Filter -> Convert this filter into SQL option
-- Venky CRMIT

Similar Messages

  • There is only record of the last 6 months shown on my history page, how can i review websites I visited before 6 months?

    i wanna view the websites I visited about a year ago, but ony the history of the last six months is shown
    how can i trace back the history?
    thx!

    Firefox 3 versions keep history for 180 days (6 months) by default.<br />
    Firefox 4 versions are later no longer keep history based on a time range, but use a maximum number of pages.
    So history older than 6 months is no longer there.
    *http://kb.mozillazine.org/browser.history_expire_days (180) (also affects saved form data)
    Firefox 4+:
    * http://blog.bonardo.net/2010/01/20/places-got-async-expiration

  • Fetch-Xml based report (to count User Access in the last 6 months ) for Microsoft Dynamics CRM Online

    Hi,
    I have created a User Access report for CRM on-premise using SQl query in the following format. One row corresponds to one user in organization. Currently, I am using Microsoft Dynamics CRM Online trial version and have two users in my organization.
    I want to the same report for CRM Online environment. Only Fetch-Xml based custom reports are supported by CRM online environment hence this SQL query cannot be used.
    I have already written fetch-xml query to retrieve user access records ("audit" entity records) in "last-x-months" (where x = 1,2,3,4,5,6) as below.
    I am able to retrieve the records with "last-x-months" condition at a time, for example, the last-2-months  in my fetch-xml query only.
    For, example, when I retrieve the records in the last-2-months, it also includes the records in the last month. I want to count the records in the 2nd month only that is the difference between these two. The difference will be my 2nd column.
    Similarly, I want the other columns.  
    For the case in the above example, I have created the two separate datasets to get the record-count for the last month and last-2-months. But, I am not able to use the two datasets in the same table in my report and hence not able to calculate the difference.
    Is there any way to solve this problem?

    Hi,
    I have modified my Fetch-XML query to retrieve all the required User Access records and removed aggregation and counting and grouping from the query as well. Did grouping and counting in SSRS. Now the report works fine as shown in the above picture.

  • Select only the last 12 months

    Hi all
    I need to write a query that will select only records from the last 12 months, order them by customer ID, and show one column per month, and a Total column where I need to add monthly Values.
    The table has the following fields
    •     YearMonth varchar(6)
    •     CustomerID varchar(15)
    •     Value integer
    Records example
    - 200809, 1, 10
    - 200809,2,20
    - 200808,1,15
    - 200808,2,12
    - 200501, ….
    I need to write a query and place it in a view that will select only records from the last 12 months, order them by customer ID, and show one column per month, and a Total column where I need to add monthly Values.
    The results should display the:
    •     CustomerID,
    •     one column per month displaying the Value
    • and the total column (sum monthly values for a customer)
    My questions are:
    •     How do I select records only from the last 12 months
    •     How do I name dynamically the columns, because today October,15 the list will start in November 2007 through October 2008, but next month it will move from December 2007 through October 2008
    •     How do I create a view with dynamic columns
    •     How do I create a column totals
    Please advice

    Hi,
    user631364 wrote:
    ... My questions are:
    •     How do I select records only from the last 12 monthsThere a a couple of things you could mean by "the last 12 months".
    Hkandpal showed you one way.
    Another is
    WHERE   yearmonth >= TO_CHAR (ADD_MONTHS (SYSDATE, -11), 'YYYYMM')
      AND   yearmonth <= TO_CHAR (            SYSDATE,       'YYYYMM')Storing DATEs in a VARCHAR2 column (or in any type of column other than DATE) is a bad idea. At best, it will involve lots of conversions, like those above.
    •     How do I name dynamically the columns, because today October,15 the list will start in November 2007 through October 2008, but next month it will move from December 2007 through October 2008
    •     How do I create a view with dynamic columns
    How to Pivot a Table with a Dynamic Number of Columns
    For example, you want to make a cross-tab output of
    the scott.emp table.
    Each row will represent a department.
    There will be a separate column for each job.
    Each cell will contain the number of employees in
         a specific department having a specific job.
    The exact same solution must work with any number
    of departments and columns.
    (Within reason: there's no guarantee this will work if you
    want 2000 columns.)
    PROMPT     ==========  0. Basic Pivot  ==========
    SELECT     deptno
    ,     COUNT (CASE WHEN job = 'ANALYST' THEN 1 END)     AS analyst_cnt
    ,     COUNT (CASE WHEN job = 'CLERK'   THEN 1 END)     AS clerk_cnt
    ,     COUNT (CASE WHEN job = 'MANAGER' THEN 1 END)     AS manager_cnt
    FROM     scott.emp
    WHERE     job     IN ('ANALYST', 'CLERK', 'MANAGER')
    GROUP BY     deptno
    ORDER BY     deptno
    PROMPT     ==========  1. Dynamic Pivot  ==========
    --     *****  Start of dynamic_pivot.sql  *****
    -- Suppress SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    SPOOL     p:\sql\cookbook\dynamic_pivot_subscript.sql
    SELECT     DISTINCT
         ',     COUNT (CASE WHEN job = '''
    ||     job
    ||     ''' '     AS txt1
    ,     'THEN 1 END)     AS '
    ||     job
    ||     '_CNT'     AS txt2
    FROM     scott.emp
    ORDER BY     txt1;
    SPOOL     OFF
    -- Restore SQL*Plus features suppressed earlier
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    SPOOL     p:\sql\cookbook\dynamic_pivot.lst
    SELECT     deptno
    @@dynamic_pivot_subscript
    FROM     scott.emp
    GROUP BY     deptno
    ORDER BY     deptno
    SPOOL     OFF
    --     *****  End of dynamic_pivot.sql  *****
    EXPLANATION:
    The basic pivot assumes you know the number of distinct jobs,
    and the name of each one.  If you do, then writing a pivot query
    is simply a matter of writing the correct number of ", COUNT ... AS ..."\
    lines, with the name entered in two places on each one.  That is easily
    done by a preliminary query, which uses SPOOL to write a sub-script
    (called dynamic_pivot_subscript.sql in this example).
    The main script invokes this sub-script at the proper point.
    In practice, .SQL scripts usually contain one or more complete
    statements, but there's nothing that says they have to.
    This one contains just a fragment from the middle of a SELECT statement.
    Before creating the sub-script, remember to turn off SQL*Plus features
    that are designed to help humans read the output (such as headings and
    feedback messages like "7 rows selected.", since we do not want these
    to appear in the sub-script.
    Remember to turn these features on again before running the main query.
    •     How do I create a column totalsIn SQL*Plus, use the BREAK command.
    In SQL, "GROUP BY ROLLUP" or "GROUP BY GROUPING SETS"

  • HT201269 When I recently transferred all the data in my 4s to my new iPhone 5, I lost the last 6 months of text messages and and calling history.  Can this be fixed?

    I use iCloud to back up  my iPhone and it backs up everything.  That's why I'm completely baffled why I have lost the last 6 months of textmessaging and phone records.  Is there anything I can do to recover this info?  I restored my new phone from iCloud and I still have my old phone.

    There's no good explanation, other than the fact that it restored an old backup.
    If you have not yet backed up the 5 to your computer connect the iPhone 4 to the computer and back it up. Then connect the iPhone 5 and restore that backup. See this also: http://support.apple.com/kb/HT2109

  • When I turn on my iPod Touch 5th generation, half of the screen has vertical white lines and it is irresponsive to the touch... is there anyway this can be fixed because this is my third time in the last 4 months I have had problems with Apple.

    The screen looks completely normal besides the vertical white lines on the right hand side of the screen, as the "slide to unlock" is lighting up and the time and date are changing, but the screen is unresponsive. After several problems with Apple in the last few months (and two defective iPods including this one and one iPhone), I really don't want to go through the whole process of bringing it in or getting a new one entirely. It would greatly help if someone knows a solution, even if that would require completely resetting the iPod to factory settings, as I have had is synced to iTunes before. It would be greatly appreciated if someone could help. Thanks.

    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes      
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem. Seems like a bad digitizer or connection or logic board.
      Apple Retail Store - Genius Bar

  • How can i get the last 2 months history?

    I want to get the call history of the last 2 months. Unfortunatelly iphone restore only the last 100 phone calls. Is there a way to retrive all phone calls from the last 2 months?

    The best way is to contact your carrier for an itemised bill.

  • I have continuously over the last 6 months struggled with syncing my iphone and ipod with itunes  The app continually crashes during the picture import.  AND by the way it takes 10-15 minutes before it even attempts to import photos.  The screen says impo

    I have continuously over the last 6 months struggled with syncing my iphone and ipod with itunes  The app continually crashes during the picture import.  AND by the way it takes 10-15 minutes before it even attempts to import photos.  The screen says importing photoes but doesnt try to optimize or anything for 10 minutes.  I have a 3gs with 16Gb so its not a cheap phone.  I have 10Gb free.  I have 6600 photoes.  This is very frustrating and undermines my confidence in your products.  My ipod is an ipod 4 with 16Gb also.  It does the exact same thing to it.  The last time, I had to import photoes a few at the time and with it taking 10-15 minutes each time for 6600 photos it is a long frustrating process.  But it will import every photo a few at a time.  The error message is just that itunes has stopped working.  no hint as to why. AND of course, my phone is out of use for the entire time.  You guys must not want to believe ur phones are a necessary tool...or maybe you dont want the consumer to believe it is.  I have tried to find solutions on your website as well as through other 3rd party communities.  Ultimately they were of no use.  I stumbled onto my solution by accident since Im a bit of a computer geek...a semi-geek.

    I have this issue too, I went into my Windows event viewer. (should have looked at this a year ago when this started)
    it said this
    Faulting application name: iTunes.exe, version: 11.0.2.26, time stamp: 0x51253247
    Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x4ec49b8f
    Exception code: 0xc0000374
    Fault offset: 0x000ce6c3
    Faulting process id: 0x14d4
    Faulting application start time: 0x01ce194399f166ba
    Faulting application path: C:\Program Files (x86)\iTunes\iTunes.exe
    Faulting module path: C:\Windows\SysWOW64\ntdll.dll
    Report Id: 0eb3c37f-8537-11e2-9351-50465d6737de
    basically whenever I try to sync my ipod touch 4G 64GB it crashes iTunes when it begins the pictures. if im lucky ill get 4-5 on there before it stops responding. its not my system or anything im running win7x64 8GB DDR3 ram (Corsair XMS3) AMD FX Eight core processor.
    It is silly that iTunes cannot add pictures to apple devices. it shatters whatever incline I may have to buy apple products. knda like the Airport Extreem router my dad bought the new firmware, caused my router to not function... why release firmware that breaks a product. -_- <-- off topic but still

  • How do I only sync the last 18 months of emails to my mac mail on the macbook?

    How do I only sync the last 18 months of emails to my mac mail on the macbook? It is currently retrieving all emails from the four accounts I am syncing to and filling up space on my macbook.  I can't work out how to set a limit.
    Any help appreciated!

    Imap is designed to synchronize your mail client with the mail server, this the normal result.
    Switch to POP access if you want it to work asynchronously

  • Creation of a Query to show the values for the current month and the last 12 months data.

    Dear All,
    Good day!
    I have to create a Query with the below requirement.
    I have to create a Query to show the values for the current month and the last 12 months data.
    Can you please guide me how to achieve this ??
    thank you,
    Regards,
    Hema

    Hema
    explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
    you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
    for some more hints..
    http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
    http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
    http://scn.sap.com/thread/3217381
    search on SDN you will get many other ways..
    Thanks,
    Bhupesh

  • How to fetch records from the database into a combo box?

    Hi:
    I&acute;m really new with ABLBPM and I&acute;m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I&acute;m using a dynamic method with this code:
    <em>for each row in SELECT campo1, campo2 from TABLE</em>
    <em>do</em>
    <em>solicitudes[] = [row.campo1, row.campo2]</em>
    <em>end</em>
    <em>return solicitudes
    </em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
    Do you know another way to do it?
    P.D. Sorry for my terrible english
    Greetings

    Hi Steve,
    Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
    fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
    Motivo: 'java.lang.NullPointerException'.
         at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
         at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
         at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
         at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
         at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
         at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
         at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
         at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
         at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    Any ideas??
    Thanks and greetings

  • My itunes won't update. It's looking for 10.6.0.40. Last time it tried to update, I downloaded the msi to my desktop and I deleted it within the last six months. Now I can't uninstall or update.

    The last time my iTunes couldn't update. I used support from Itunes and downloaded it my desktop. My mistake. Because without thinking, I deleted it within the last six months from my desktop, without thinking I'd need it later. For the past month I've needed to update my Itunes and it can't find the msi. Now, my Ipad, my kids' ipod touches and my iphone can't update. Especially the ipod touches, iphone and work ipad have already updated to the OS6. And, now they won't work with this outdated iTunes. Help.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • My Verizon wireless service at my house has begun to degrade over the last 6 Month.  It has begun to be very frustrating seeing how we switched over from Satellite to Verizon 4GLTE wireless device.  How do I contact someone to see what the issue may be. Z

    My Verizon wireless service at my house has begun to degrade over the last 6 Month.  It has begun to be very frustrating seeing how we switched over from Satellite to Verizon 4GLTE wireless device.  How do I contact someone to see what the issue may be. Zip Code 22580.

    Out of curiosity how much data per month are you using?  Another factor could be if neighbors have all done the same thing as you and the node is being overloaded on home internet use.

  • Is it possible to sync all the email in a folder, not just the last few months worth?

    Is it possible to sync all the email in a folder, not just the last few months worth?

    Hi Mengelkemier,
    I think you're posting in the wrong forum.  This forum is intended to be used to discuss virtualizing Exchange Server on the the vSphere platform.  The question you're asking seems to be a mobile device specific question.
    You would probably get better visibility posting on a forum dedicated to your particular device.  And for what it's worth, some devices will let you sync all of your email and others will only let you sync a certain amount.  It's dependent on the device you're using.
    Good luck in finding your answer.
    Matt

  • The calendar sync is recently not working correctly, not display "All events" but it only displays the last six months for my individual entries. My repeating entires do go back further, though. How do I fix?

    I have an iPad 5.1.1. The calendar sync has started to not work correctly. I have it checked "All events," but it only displays the last two months for my individual entries. My repeating entires do go back further, though. How do I fix?

    HI Jason269. Thanks for your reply, however I wrote that I already have "All events" checked. If All Events is checked and it doesn't diaplay all events, how do I fix? It seems this is a common issue, as I have read many others on here state the same problem.
    I believe my problem occurred when I synced my iMac calendar to my iPad calendar using yahoo. Yesterday, I unsynced them on my iMac controls. When I checked my iPad calendar, all of my old entries reappeared - but only for five seconds and disappeared again. So, the data is saved and still there but cannot be displayed, even when I have All events checked. In fact, it only shows my individual entries for the last two months, but does show all my recurring entries. If I switched to last six months, I will see everything for the last six months. If I switch back to all events, it is only for the last two months.
    As I mentioned, others on here have expressed exactly the same issue, including the two month example and having used yahoo.
    For legal purposes, I need to be able to use the information from my indidual calendar entries in an upcoming court case. So I really need to fix this ASAP!

Maybe you are looking for

  • Is there any way to use iPod touch with Win2000/SP4?

    Got an iPod touch for christmas... very cool. It doesn't synch with my computer... not so cool. The information I've found - compatibility chart at http://docs.info.apple.com/article.html?artnum=60971 - suggests that I'm SOL with Win2000 - it appears

  • Down payment process on basis of document conditions

    I am trying to setup the down payment process that uses document conditions (available since EH2) and I'm struggling with it.  I can't get any values to show in condition type AZWB.  I'm wondering if anyone has any experience with this process and ca

  • IPhoto 09, Nikon D90 Camera and GP1 GPS unit

    I own a Nikon D90 camera, and have just ordered a Nikon GP 1 GPS unit to use with it. I was wondering if there was anybody in the forum with this setup already, and what experience they are having using it with iPhoto 09. I have written Nikon, and am

  • Why can't i get all of the songs that are in tunes on my ipod

    What can I do to get all of my songs that are in my tunes library onto my ipod. Thank you

  • Purchasing TV Shows in SD

    I found something weird this morning... I was trying to purchase the TV show "Eureka" and since I didn't care for HD (I watch on my iPhone), I clicked on "This show is also available in SD", so iTunes switched me over to the $1.99 shows in SD. But, w