Need to Create a Date for Use in Filter

I need to set a filter to the effect of Modified Date >= [CURRENT_YEAR] || '02-01' and can't seem to get the filter right to allow me to concat/insert the year to the '02-01' to just get MM/DD/YYYY = 02/01/[Current Year]. It keeps throwing SQL errors.
Here is the text I used to get the string but I can't seem to get this into an actual date format. I've tried doing CAST as DATE and doing a DATE 'YYYY-MM-DD' format as well.
CAST(VALUEOF(NQ_SESSION.CURRENT_YEAR) AS CHAR)) || '-02-01'

Ok. I finally found something that will work no matter what month we are talking about. The goal was to find the first day of the prior month so I always look for the two months activities.
So if current date is 06/08/2010 then I wanted all activities >= 05/01/2010. If the date were 01/12/2010 then I would want 12/01/2010 as my date to filter etc. It is the rollover that messes up most of the date logic when using date parts as filters.
Here is what I came up with and it works great. You basically subtract a month from today's date and then subtract the number of days (minus one) to get back the first of the prior month.
TIMESTAMPADD(SQL_TSI_DAY,
((DAY(TIMESTAMPADD(SQL_TSI_MONTH,-1,VALUEOF(NQ_SESSION.CURRENT_DT))) -1) * -1)
TIMESTAMPADD(SQL_TSI_MONTH,-1,VALUEOF(NQ_SESSION.CURRENT_DT)) )

Similar Messages

  • HT5622 We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids? Thank-you

    We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids?
    Thank-you

    1. Yes, it is.
    2. You may be able to use the same address by adding a plussed suffix to it, such as [email protected] If that doesn't work, create separate emails.
    (103279)

  • I have a western digital external hard drive that needs to be re formatted for use on my but iMac but I do not want to lose existing data

    I have a Western Digital external hard drive that needs to be re formatted for use on my iMac, but I do not want to lose existing data, is this possible ?

    Formatting a disk always erases all the data on it. Your only option is to back it up elsewhere and restore it once formatted.

  • Do I need to create a view for this?

    Hi Ihave got 2 tables emp and project
    In emp tabe:
    emp_no
    family name
    given name
    In porgect table:
    emp_no
    status(assigned,unassigned)
    start_date
    end_date
    emp_no Family_name given_name
    1 Smith John
    In project table same employee can have many assigement eg
    emp_no status start_date end_date
    1 assigned 01-may-08 01-july-08
    1 assigned 01-sep-08 01-july-09
    1 unassigned 01-july-09 01-oct-09
    In the form:
    there are 2 querable fields "project ends between field1(date) and field2(date)" which is used to
    retrive records which have end date between field1 and field2.
    The following fields are needed to get from database:
    emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
    Requirements:
    1. project.start_date and project.end_date must be the latest project_end_date for the same emp
    so in the above sample date
    2. No. of time assigned is a count of total of number records which have status='assign'
    So for the given sample data the record expected after query would be(field1=01-jun-08 field2=02-july-09)
    emp.family_name emp.given_name project.start_date project.end_date No.of time assigned
    Smith John 01-sep-08 01-july-09 2
    What is the best approach to get:
    1 The lastest project(latest end_date) for the emp
    2. get No.of time assigned.
    Do I need to create a view for this? If yes, any sample sql code this this?
    Thanks for your help

    Hi W1zard,
    Thanks for your reply. Could you clarify the following points for me:
    1.) you could create a master block basing on your emp table and a detail block basing on your project table with the relation over emp_no. set the default_where clause of your detail block programmatically using
    set_block_property('project', default_where, 'status = ''assigned'' and <your_date_criteria>');
    Q1: where I pit this code? in pre-query trigger in detail block?
    2.) Of course you could create a view to join both of your tables if you don't want to use master detail blocks; Also do the join over emp_no
    create or replace force view v_emp as
    select emp.family_name, emp.given_name, project.start_date, project.end_date
    from emp, project
    where emp.emp_no = project.emp_no
    Q2 As I mentioned before, there are multipal entries for the same emp in project table and we only need the maching record from project table which has latest end_date. So I think I need something like
    max(project.end_date) somewhere in create view to make sure only one record for one employee.
    Also is there possible to include the no. of assigned field(select count(*) from project where status='assigned' and emp=emp_no) into the view as well?
    Q3 All the fields mentioned above are diaplay-only. So Can I create a control block which has all the fields from emp and project. Then populate them with my sql. The question is
    where I put this customerised sql so when user click excute query. My sql will run and display one the form?
    REally appreciated your help!
    Michael

  • Creating test data for a problem

    Hi,
    I've been using this forum for a few months and it has been extremely useful. The problem is that I actually have no idea how to create test data for a specific problem. I've tried googling but to no avail. I have had other users create test data for some of my problems using a 'WITH' statement but it would be great if someone could explain the logic behind it and how to approach a specific problem where in the query I use multiple tables.
    I know it's probably a stupid question and I'm relatively new to sql but it would help a lot if I understood the process.
    Banner:
    Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Look at the point 3 and 4. You can also follow other points too.
    Please consider the following when you post a question. This would help us help you better
    1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
    You can use the following query and do a copy past of the output.
    select * from v$version 2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
    that are asked the answer is already there.
    3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
    I have the following table called sales
    with sales
    as
          select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
          union all
          select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
    select *
      from sales 4. Rather than telling what you want in words its more easier when you give your expected output.
    For example in the above sales table, I want to know the total quantity and number of invoice for each product.
    The output should look like this
    Prod_id   sum_qty   count_inv
    1         145       2 5. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
    6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
    Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
    use the {noformat}{noformat} tags.
    The usage of the tag is like this.
    <place your code here>\
    7. If you are posting a *Performance Related Question*. Please read
       {thread:id=501834} and {thread:id=863295}.
       Following those guide will be very helpful.
    8. Please keep in mind that this is a public forum. Here No question is URGENT.
       So use of words like *URGENT* or *ASAP* (As Soon As Possible) are considered to be rude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need to Create a Check for Plant in WBS & Plant in Network

    Dear Guru's,
    While creating Project (CJ01) my users are creating in a Plant, and while creating network for the same project/WBS, they are using different Plant Code.
    Since my Profit center is related to the plant in CJ01,
    and because of wrong Plant in network, all my PR/ PO is going in a different Profit center, which is creating a huge problem while auditing.
    I need to Create a Check for Plant in WBS & Plant in Network...!!
    Kindly suggest me the ways to do it and how to do it...

    Hi Deepa,
    The Check you are trying to create between Plant defined at Project def and network level that should be same can be achieved through validation at the network level by using a user exit at network level.
                    While creating the network you can change the plant value not equal to the value at proj def/network profile may be one of the reason is since the network type is defined for more than one plant (OPUV).
                    While creating validations at network level we do not have the option of setting the prerequisite/check  using WBS or Proj def fields (i.e. PROJ-, PRPS- fields)    so we need to create a user exit at the network level.
    I am not sure but logically u can have a user exit for both prerequisite and check steps of the validation.
    You need to create the user exit in program ZGGBR000.
    Please take help from your Abaper for the same.
    OPSI-Network header-Validation- Step - Prerequisite u2013 Check u2013 Message.
    Prerequisite
    If Proj Profile = u2018XXXu2019 and Network Profile = u2018XXu2019 (or as per your logic if need be use a exit)
    CHECK.
    PROJ-WERKS = CAUFVD-WERKS   (This logic needs to be defined in user exit and set the same user exit at the check.)
    Once you define the user exit in ZGGBR000, it will be available in the tab u2018exitsu2019 at the Prerequisite and Check levels.
    The name of the form pool (e.g., ZGGBR000) that contains your user exit must be stored in table T80D.
    It is important that you make declare the code generation program for your user exit; how many and what type of parameters you are using for the user exit. You do this by entering your newly defined user exits in the form routine GET_EXIT_TITLES. Found in program ZGGBR000.
    Check with your Abaper to check on all the aboveu2026
    Message:
    Plant at Network level should be same as at Project def level.
    Hope it helps you,All the best..
    Regards
    Vinayak.

  • I need to create  .pst  ext . file using java,whi will import in ms outlook

    {color:#ff0000}*I need to create .PST extension file using java which will be able to import in ms outlook,and that .pst file will contain root folder (like Personal Folders) and inbox,sent mail*{color}
    give me some hint It is essential task .we have to implement code in  java

    I'm using the thin drivers.
    The answer to your question is no, you do not need to create a DSN to connect to Oracle. The Oracle thin driver is all that is required. Your code looks OK to me, I'm assuming that you xxx'd out the IP, and that you are using a real IP in the actual code.
    The message you got back is pretty generic, but can indicate that the Oracle database listener isn't available. Perhaps the database is on a different port, or perhaps the listerner isn't running. Perhaps you have the IP address wrong.
    So, to be very basic:
    1) Can you ping the server you are trying to connect to? This makes sure you are using a valid IP address.
    2) Can you connect to the Oracle server from an Oracle client? This makes sure the listener is running properly, and that you know the correct port number and login information (The port number could be in a local or server based TNS file, or available through an Oracle names server. You might try using the program tnsping if it is available on the client for validation.
    3) If you can do 1 and 2, then be sure you are using the same connection parameters (server, port userid and password) that worked with 2.
    4) Verify that you are using (pointing to) the correct set of Oracle classes for the thin connection. This can be tricky if you have different versions of Oracle on the client then on the server, but is documented on the Oracle website.
    5) If everything checks out, you might want to verify that you are using the most recent versions of the thin drivers, including the Oracle patches.
    Hope it helps - good luck,
    Joel

  • Do we need to create two zones for Two HBA for a host connected with SAN ?

    Hi,While creating Zone , Do we need to create two zones for Two HBA for a host connected with SAN ? Or a zone is enough for
    a host which having Two HBAs...We have two 9124s for our SAN fabric...
    As I found like one zone  below, I little bit confused that , if a host having two HBA connected with SAN, should I expect two zones for every Host?
    from the zone set, I gave the command show zoneset
    zone name SQLSVR-X-NNN_CX4 vsan 1
        pwwn 50:06:NN:NN:NN:NN:NN:NN
        pwwn 50:06:NN:NN:NN:NN:NN:NN
              pwwn 10:00:NN:NN:NN:NN:NN:NN
    But I found only one zone for the server's HBA2:by the same time in the fabric I found switches A & B showing the WWNs of those HBAs on its
    connected N port...Its not only for this server alone, but for all hosts..Can you help me to clarify on this please..that should we need to create one zone for
    one HBA?

    if u have two independent fabrics between hosts and storage, i think the below confs are recommended.
    Scenario 1:  2 HBAs single port each ( redundancy across HBA / Storage port )
    HBA1 - port 0 ---------> Fabric A ----------> Storage port ( FAx/CLx )
    HBA2 - port 0 ---------> Fabirc B ----------> Storage port ( FAy/CLy )
    Scenario 2: 2 HBAs of dual port each
    HBA1 - port 0 -------> Fabric A ---------> Storage port ( FAx/CLx )
    HBA2 - port0 ---------> Fabric A ---------> Storage port ( FAs/CLs )
    HBA1 - port 1 --------> Fabric A --------> Storage port ( FAy/CLy )
    HBA2 - port 1 ---------> Fabric B --------> Storage port ( FAt/CLt )
    the zone which is in your output is VSAN 1. if its a production VSAN, Cisco doesn't recomends to use VSAN 1 ( default vsan ) for production.

  • Do we need to create message interfaces for idocs and rfcs thatare imported

    do we need to create message interfaces for idocs and rfcs thatare imported
    from sap server
    in scenarios from sap system to file or vice versa
    i knew that we need not create message types
    do we also skip creating message interfaces

    hi,
    you create an abstract message interface for IDOC only if you want to use
    them in a BPM (integration process)
    for more about IDOCs have a look at my book:
    <a href="/people/michal.krawczyk2/blog/2006/10/11/xi-new-book-mastering-idoc-business-scenarios-with-sap-xi"><b>Mastering IDoc Business Scenarios with SAP XI</b></a>
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Help!  Help!~I need to create a room for a Robot to move in!!

    I need to create a room for a robot to move around in. How do I go about doing this?
    Im not sure where to start.
    Thanxs

    Could you define a shape and just have the robot check its proximity to the wall?
    I did something similar a couple of years ago where my hunter bots had to chase the rabbit bots and the rabbit bots ate the grass... you get the picture
    The hunters were able to see the rabbits and they were attracted to the area with most of them. The rabbits were able to see the grass and the hunters and were attracted to grass but if a hunter was in sight, that was overridden and they moved away from the hunters.
    The controllers were simple neural nets which were set up through GAs.
    How will your robot detect the walls? I mean, will it be able to pinpoint its position in the room or will it only have visual info (it will "see" the wall to its right etc)?
    If the first, I would be inclined to use some shape and just check for the position of the robot compared to the boundaries.
    If the second, I would make the shape out of a whole load of Point objects and arrange them in the shape of the room. The benefit is that you will be able to specify some vision function based on how many Points are within his field of vision, and then get the net to learn that the optimum value is x... or something like that. It has been a few years since I did that stuff.

  • How to create Geniric data source using the SAP FUNCTION MODULE

    Hi,
    I want to create genric data source using function module
    MD_STOCK_REQUIREMENTS_LIST_API (delivered by sap)
    for this function module where I can find  Extract Structer
    or I have to create ?
    How can i use this ?
    Thanks in Advance

    Hi Shilpa,
                  Check here..........
    Using function module as the generic extractor
    Generic Delta Update using Function Module
    Document regarding R/3 extractors using function module/user exits
    Generic extractors using FM

  • Creating Master Data Centrally Using Guided Procedures

    Is it possible to create master data centrally using GP say for example creating Material master data without using MDM? Is there a stand out of box delivered scenario exist without MDM. I did see the article Create Master Data Centrally Using Guided Procedures but it uses MDM.
    Any help appreciated.

    Wow, that was indeed a quick reply i have ever got on SDN. Thanks for the excellent link jitesh. However, where will i get the deployable files that it selects in the Import GP/CAF contents step of the demo? those are the webdynpro components files. One is SCA and other is SDA. Where will i get them?
    Kindly post the link to those files if u have them or else send it across.
    Regards,
    Ameya
    Edited by: Ameya Pimpalgaonkar on Sep 27, 2008 11:53 AM

  • HT4191 iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.

    iPhone Local Storage "My iPhone" - How do you create this folder for use by the Notes app on a iPhone or iPad?  If I want to keep some notes only on my device and not in a cloud environment associated with an e-mail account.  I've seen reference to the  "My iPhone" local storage put no mention on how you create this folder or access this folder within the Notes app.  I realize storing information in a local storage like this provides no syncing between other iDevices but that is exactly what I'm looking for.  I'm running iOS7.0.4 on a iPhone 5S, and a iPad Air.  Any help would be greatly appreciated.

    If you go to Settings > Notes > Default Account you will see "On My iPhone" as the default account and the only choice if you have not enabled syncing Notes in Settings >iCloud or Settings > Mail, Contacts, Calendars. If you have enabled syncing you can still select "On My iPhone" as the default account. When you are in the Notes app you won't see any accounts listed if you have not enabled syncing because they are all in the On My iPhone account and that is the only place possible. It is not a folder that you create.

  • What is the need of creating partner functions for sales document type.

    Hi SAP (SD-GURUS),
    Actually we create partner functions  before creating customer ex: sold to party, ship to party, bill to party, and payer.
    These partner functions are going to be copied into sales order while processing sales order.
    Again what is the need of creating partner functions for sales document type.
    Thanks&Regards
    sreenivas peruru

    There are some Partners you could enter at Sales ORder Level. E.g. Sales Person, Employee Responsible, Forwarding Agent, Broker, etc.
    Thus these partner Determination need to be carried out at Sales Order Level & not at Customer Master level.
    So we have to configure partner Determination for various levels e.g. Customer Master, Sales Order, Delivery level etc...
    Hope this helps...
    THanks,
    Jignesh Mehta

  • I wanted to send some photos out but was told I need to create a new profile, use mail icon in control panel no icon there how do I get it done?

    I want to send some photos from Firefox, when I tried it said I need to create a new profile, use mail icon in control panel. I went to control panel and do not know what to do.'''bold text'''

    As all of the msuic came from your computer in the first place it should still be there.  Is it not?
    EVERYTHING on your ipod should also be on your computer and should be included in your regular backup copy of your computer.
    Make sure that everything is on your computer.  You can transfer itunes purchases from the ipod.  Without syncing:  File>Transfer Purchases.
    When everything is on your computer, then it can be synced back to the ipod after updating.

Maybe you are looking for

  • Can not do JPA/Hibernate ... Reverse Engineering with MySQL

    Hello, I'm using MyEclipse 7.1.1 and MySQL 5.1.34. The MySQL connector with java is mysql-connector-java-5.1.7-bin. I tried so many time to generate Hibernate/JPA class by MyEcipse but it still did not work. Here below are my error log (which i copie

  • Error While saging the payroll in assignment

    Hi, i am getting a error "APP-PAY-06153: System Error: procedure hr_entry.derive_default_value at step 6" while saving the assignment information after setting some payroll. can any body me help on this issue. thanks in advance.

  • E-Seminar connect error

    I am trying to view some e-seminars and while I can authenticate. there is a browser check screen that generates a gray rectangle, eventually a red 'X' appears in the upper left corner and nothing further happens. I am running W2K-P w/ IE6 6.0 and it

  • GDM going into fallback mode with fglrx

    I've installed Arch linux a couple of times to have a play around with it, and I've really enjoyed it so yesterday I installed Arch linux again, this time with the intention of using it as my main OS. During the installation I configured pacman to us

  • Viewing my loaded data

    Can anyone tell me why I am getting the error below after executing my control file and also why I can't view that data which was loaded. SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 12 16:28:57 2007 Copyright (c) 1982, 2005, Oracle. All ri