Search by age where date is in field

I am creating search and reselt page with session.
Members are with birthdate in field, I did convert birthdate
in to number with datediff().
It converts, But when I use this it gives error.
<cfif session.search.agefrom is not "">
and #dateDiff("yyyy", e.birthdate, Now()))# >=
#Session.Search.AgeFrom#
</cfif>
This is part of code I did.
It gives error and doesn't recognise e.birthday even though
it is.
If I just use e.birthday it works.
Do I need to add another query in query?
If so Will you please help me?

This is copy of code I wrote!
<cfquery name="get_Partner" datasource="marriage1">
SELECT f.Memb_ID, f.Memb_Gend, f.Scre_Name, f.Memb_City,
f.Memb_Stat, f.Memb_Coun, e.Birt_Date, e.Smal_Imag
FROM Memb_Info f INNER JOIN Memb_Prof_11 e
ON e.Memb_ID = f.Memb_ID
WHERE
0=0
<cfif SESSION.Search.userFilter is not "">
AND (f.Memb_Coun LIKE '%#SESSION.Search.userFilter#%' OR
f.Memb_Stat LIKE '%#SESSION.Search.userFilter#%')
</cfif>
<!--- Also filter on From date, if provided --->
<cfif isDate(SESSION.Search.dateFrom)>
AND e.Birt_Date >= #dateDiff("yyyy",
Session.search.datefrom, now())#
</cfif>
<!--- Also filter on Through date, if provided --->
<cfif isDate(SESSION.Search.dateThru)>
AND e.Birt_Date <= #dateDiff("yyyy",
Session.search.datefrom, now())#
</cfif>
What I want is enter age like 25, 30, and so on in search
field where field has date information.

Similar Messages

  • WebApp search by ItemID - where to find the field name for this?

    We want to search against the unique key that is the ItemID on WebApp items. We cannot find any information on what this field name or item ID might be called (beyond the obvious ItemID which does not work when we've tried it) and therefore we cannot search WebApps using the most important field in the WebApp! I've chatted to two different support agents both of whom said they don;t know nor do they think it can be done because the system auto-assigns CAT_custom ID on this. Either the guys do not know what the system can actually do but I cannot believe that we cannot search against the WebApp Item IDs?
    Does anyone know the answer?
    As a matter of interest I note that ItemName and ItemDescription fields are called exacty that, and thus we can search against ItemName
    Help!
    Thanks
    Wayne

    Yeah, I know it's not quite as versatile as a search, but generally if you are searching by ID you would know the ID and you would only want the one result, so it can be made to work relatively easily.
    I'm using it as an ajax call - seems to be a bit tricky as there's no way to stop BC adding the <head> element etc. I'm using a javascript text search to locate the script tag -  Unless you know of a way to call this as a JSON file? (clutching at straws here)

  • CIC0- Add Date of Birth Field in the BP Search,

    Hi,
                Please do let me know the procedure for adding the Date of Birth Field in the BP Search of Interaction Client Center.
    I have activated the Field  BP1_BIRTHDATE in the CRMC_CIC_SEARCH_CNTR,
    and i have changed the Layout of the HTML Page via the Transaction SMW0 in the SAP WebRepository in the CRM_CIC_COMPONENTS package.
    Now im able to find the Date of Birth Field in the CIC0 but while i'm trying to search based in the Date Of Birth field it is not working it.
    Please do suggest me what i have to do.
    Anilkumar.

    How can you expect to search on DOB basis if its not suported at the BOL level. Make sure the business logic is written to carry out search on DOB basis.
    You need to enahcne the already exsiting search code to support search on date of birth basis.
    <b>Reward Points if useful</b>

  • Setting up a web app search field that searches all web app data

    Hi BC forum
    We have this web site - bridgerd.com.au - and we are finding limitations with the web app search bar (where it says: Search Bridge Rd). This search bar will only search for data within the Web App 'description field'. We're wanting it to work a little more like the site search module, where it searches all content of a particular web app - including data from different fields.
    Obviously this would be a great out-of-the-box feature for BC, and it seems to be an annoying limitation. Has anyone overcome this issue before? Is there a way to search all fields by concatenating a bunch of hidden fields into one submitted search using java script. Or could we using java script to copy the same entered search value to all fields whilst hiding all but the main search field?
    Cheers

    Actually, let me clarify this... Is there a way to expand the "Keyword" field search in web apps past the limits of only searching the "Content" field?
    OR
    Is it possible to include the custom fields in our web app to the search criteria? When I add the web app to the page, it seems BC will only add the default web app search fields. If I can add the custom web app search fields, I may be able to employ my theory as per last post.
    Cheers

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • Converting varchar to datetime where date field is missing

    Hello Sir,
    i have a column with varchar datatype values like '2013/12','2012/11' where date field is missing.  i want to convert it as datetime at runtime so that i can use datetime related function. Is it possible for ms sql server 2008?
    thanking you.

    >> I have a column with VARCHAR data type values like '2013/12', '2012/11' where DATE field is missing. I want to convert it as DATETIME2(0) at runtime so that I can use DATETIME2(0) related function. Is it possible for MS SQL Server 2008? <<
    The most important leg on a three-legged stool is the leg that is missing :)  A DATE is made up of three fields; YEAR, MONTH and DAY. You gave no business rule for picking the DAY field, so this makes no sense. 
    Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
    The report period table gives a name to a range of dates that is common to the entire enterprise. 
    CREATE TABLE Something_Report_Periods
    (something_report_name CHAR(10) NOT NULL PRIMARY KEY
      CHECK (something_report_name LIKE <pattern>),
     something_report_start_date DATE NOT NULL,
     something_report_end_date DATE NOT NULL,
     CONSTRAINT date_ordering
      CHECK (something_report_start_date <= something_report_end_date),
    etc);
    These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
    data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00' in the CHECK constraints. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Preferance pane window keeps popping open when entering search or data into any fields. I'm also using 1Password and it happens when trying to enter a password

    I'm running on Mac OS X 10.7.4, Firefox 14.0.1. This issue didn't exist until this most recent Firefox update. Basically, a preference pane opens every time data is being entered into a field. It doesn't seem to be the same preference pane that you see when you open the preferences through the normal Firefox access ie. Firefox > Preferences. All of the choices listed in this particular preference pane are specific to Firefox though. I have a screen capture that I could include if wanted. When using 1Password the pane appears, when entering a search in the search bar near the address bar the pane pops up, when entering data into any field as I am now filling in this detail report the pane also pops up. It's quite annoying. Any advice? I'm going to systematically attempt to quit any add-ons and see if that makes a difference. I ave already tried doing a reinstall to no avail.

    I think a screen shot would be helpful. There is a box below the compose area of a reply to upload files.

  • Beginners question - making sense of form, item, pane & variable (with relation to where data is stored in the SQL database)

    Hi Everyone,
    I am new to writing reports (SQL code) for SAP, however I am aware that inside SAP Business One it is necessary to enable System Information (from the View menu) in order to see which tables (and related table attributes / column names) are related to various aspects of the various SAP 'modules' (e.g.: A/R Invoice).
    Using an A/R Invoice as an example I can see at the row (or line) level that an item with the description of 'Opening Balance Transfer' is contained in the table INV1, within the attribute (or column) called Dscription.
    However not every 'on screen object' shows a table / attribute. For example in the same A/R Invoice if I hover my mouse over the Balance Due field all I see is Form related information.
    My question is 'How do I make sense of the Form, Item, Pane, Variable information?', with relation to where data is stored within the SQL database?
    Links to online tutorials explaining how this feature of SAP Business One will be much appreciated, along with any personal advice regarding working with this information.
    Any (and all) help will be greatly appreciated.
    Kind Regards,
    David

    Hi David,
    1.Here I am explaining use of each field except pane
    a. Form ---> Used in additional authorization creator
    b. Item, column--->Useful in creating Formatted search queries (FMS)
    c. Variable --> Some of the field values based on another values. ie. indirect values.
    d. INV1---Table name
    2. How to get variable?
    As per your second attachment, to get balance due ,you need doc total field from OINV table. For example,
    SELECT T0.[DocNum], T0.[DocTotal] FROM OINV T0 WHERE T0.[DocNum] = 612004797
    Thanks & Regards,
    Nagarajan

  • KQL Query - Sharepoint 2013 Search - Filter by empty date value

    Hey,
    I'm using Microsoft.Office.Server.Search.Query.KeywordQuery class to query the search service. By using the following KQL query, I can get all the crawled items of a specific content type filtered by Expiration Date:
    (ContentType:"MyContentType") (PublishingExpirationDateOWSDATE>=2013/08/07)
    PublishingExpirationDateOWSDATE is of type Date (it's not the default metadata property that SP creates when you do a full crawl, since that one is of type text, i deleted and recreated it as date time). I just did this because i needed to be able to sort
    the results by that value, and it was impossible when it was just text.
    So, now my problem comes when i want to include those values where the PublishingExpirationDateOWSDATE > (today) or are emtpy (in other words, the not expired items).
    I found no way of targeting the items where the date is empty. Is there some way? Some special syntax to get them?
    I just come up with another idea, that would be having another managed property bound to the same crawled property of type "text", and just comparing that one to "". But i don't want to have the need of having to separate properties.
    Is there some way?
    Antonio Briones Northridge Systems C# .net developer for win and web forms. I work for

    Hi Antonio,
    Search does not create index of any field which is left empty. A query filtering data based on PublishingExpirationDateOWSDATE
    > (today). Will give you all the records with date greater than today's date ignoring the time also.  Records with date empty will not appear in your results. 
    You will not be able to achieve this with custom search results web part also.
    Try CQWP.
    Navish Rampal

  • What is the use of search helps? where can we creat it?

    use of search helps and where can we create it?

    Hi narendra
    LOCK OBJEC TS
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    SEARCH HELPS
    1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
    2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
    3)An elementary search help defines the standard flow of an input help.
    4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
    5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
    6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
    pls go through this for search help creation
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    Search Help Exits:
    Re: dynamic values for search help
    Re: Dynamic search  help
    Match code objects are same as Search helps, where they are used in Previous versions of SAP.
    Now in the newer versions Search helps are replaced them.
    Standard Texts are the texts which are maintained in SO10 Tcode
    Every SAP application document is maintained with HEADER and ITEM texts
    and these texts are fetched from SAP using the READ_TEXT Function module
    by passing TEXT ID, TEXTNAME,TEXTOBJECT and LANGUAGE fields
    You can double click on any long text in the systesm and you can see these paramters in the text editor.
    Text Modules are created and used in Smartforms.
    check these links
    http://www.sap-img.com/abap/attach-a-search-help-to-the-screen-field.htm
    http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/97/24a23fa34ffb47e10000000a114084/content.htm
    Reward points if useful
    Regards
    Pavan

  • Query to search between two specific dates and time period

    Hi,
    Need a query to search between two particular dates and time period
    Like i want to search table having one date field .
    Suppose the date range is '01-JUL-06' and '01-AUG-06' and time frame
    is 23:00:00 to 08:00:00
    i.e i want to search between dates 01 july to 01 aug and also within the time frame i.e 23:00 to 08:00 hrs only

    The general principle is
    SELECT * FROM your_table
    WHERE some_date BEWTEEN to_date('01-JUL-06') and to_date('01-AUG-06' )+0.99999
    AND  ( some_date <= trunc(some_date)+8/24
               OR  some_date >= trunc(some_date)+23/24 )
    /Cheers, APC

  • Search for a space within a text field

    Hi All
    I am trying to search for a sapce within a text field but sofar not being very successful. I have used:
    FIND search_str
               IN text_str
               MATCH COUNT  lv_mcnt
               MATCH OFFSET lv_moff.
    where search_str = TYPE c VALUE ' '.
    I am looking a way of searching a character within the string using ABAP (like INSTRING in other languages). If you have similiar codes - Could you please post me a copy - Thanks

    HI
    Check this..
    DATA string7(30) TYPE c VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH string7 FOR 'X'.
    WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',
                   sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 'itt   '.
    WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',
                       sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '.e .'.
    WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',
                      sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '*e'.
    WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 's*'.
    WRITE: / 's* ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    Thanks ,
    Praveen

  • Data carrier & application field are not getting displayed in CV04N

    Hi Guru's
    In TCode : CV04N,  data carrier & application field are not getting displayed.
    While i compare with my IDES system, data carrier & application fields are getting displayed in CV04N.
    Let me know is there any configuration that has been missed out.
    Regards
    Bhanu

    Hi Bhanu,
    Please note that the fields 'Data carrier' & 'Application field'  are visible only if no document type is entered.
    Suppose you enter a document type and press ENTER then these fields disappear. This is because the field 'Application' was designed when only the storage is archive, vault or SAP-SYSTEM was possible and the number of added originals was limited.
    Currently DMS allows storage of originals on Content Server and there is no limit on the number of added originals, the system behavior was changed due to performance reasons. To avoid performance problems if you search for a document with a lot of originals attached this field gets invisible if you enter a document type which uses the KPRO storage.
    Regards,
    Pradeepkumar Haragoldavar

  • Vendor ageing report data for all doc type needed(urgent)

    hello everyone
    once again i need ur help guys.
    in the vendor ageing report i am getting data for only one document type and not of other.
    ex- see i have two documents type-
    1.KD 2. EJ
    so i am getting data for document type KD only.
    so how to get the data of document type EJ along with KD.
    below is my code .
    so tell what modifications i have to made .
    *& Report  Z_VENDOR AGEING                                                    *
    *&  in this repoet I am calculating the vendor ageing
        which is depending on formula
        AGEING = Current Date(or any date entered by user) – Bline Date(BSIK-ZFBDT)                                                                 *
    REPORT  z_vendor  NO STANDARD PAGE HEADING
                      LINE-SIZE 200
                      LINE-COUNT 65(3).
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
           bukrs LIKE bsik-bukrs,
           saknr LIKE bsik-saknr,
           bldat LIKE bsik-bldat,
           wrbtr LIKE bsik-wrbtr,
           lifnr LIKE bsik-lifnr,
           zfbdt like bsik-zfbdt,
           zbd1t like bsik-zbd1t,
           ageing type i,
           END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
                     s_saknr FOR bsik-saknr,
                     s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
           FROM bsik
           INTO  TABLE t_out
           WHERE saknr IN s_saknr
           AND bukrs IN s_bukrs
           AND lifnr IN s_lifnr.
    Loop at t_out.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = p_date1
        i_datum_von                   = t_out-zfbdt
      I_KZ_EXCL_VON                 = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                  = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
    IMPORTING
       E_TAGE                        = t_out-ageing
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Modify t_out.
    Clear t_out.
    Endloop.
    LOOP AT T_OUT.
    IF T_OUT-SHKZG = ‘H’.
    T_OUT-WRBTR = T_OUT-WRBTR * -1.
    T_OUT-WRBTR = T_OUT-DMBTR * -1.
    ENDIF.
    DATA: TOTAL(16) TYPE P DECIMALS 2.
    TOTAL = TOTAL + T_OUT-DMBTR.
    Endloop.
    LOOP AT t_out.
      WRITE : / t_out-saknr,
                t_out-lifnr,
                t_out-wrbtr,
                t_out-zfbdt,
                T_OUT-DMBTR,
                t_out-ageing.
    AT LAST.
    WRITE:/ TOTAL.
    CLEAR TOTAL.
    ENDAT.
    ENDLOOP.
    Message was edited by: sanjeev singh

    Sanjeev,
    Can you tell what is document type EJ representing...Secondly, if you check couple of documents of EJ type and check if data is available as per you WHERE clause filters.
    Regards
    Anurag

  • Creating a new Search Help on a standard SAP table field?

    Good day, everyone!
    As part of a report I am writing, the customer would like to have Search Help added to the AUFEX field in table AUFK.  They would like this functionality so that when they are changing an order via t-code ko02, they can get a list of valid values to put in field AUFEX.  I would like to tie it to a zTable I've created; in my zTable, I have just 2 fields:  a key value (that will go into AUFEX) and a text description of the key value.  This zTable is used in my report.
    While I've created a Search Help on this table already for table maintenance, I've never added a custom Search Help to an existing standard SAP table field before.  I've done some Googling and other searching to see what I need to know, but I've only been able to find information on Collective Search Helps.  AUFEX doesn't yet have a Search Help field, so I don't think Collective Search Helps is my answer.
    Is this possible?  Can I add a custom Search Help to a standard SAP table field that doesn't have any Search Help linked to it yet?  Is there an existing thread or guide somewhere that can tell me how to do this?
    Thank you!

    Hi
    Yes u can: u can assign the search help to (A) data element livel or (B) field table livel.
    After creating your search help:
    A) Run SE11, insert your data element (AUFEX), press edit and insert the search help in "Search Help" area on DEFINATION tab;
    B) Run SE11, insert your table (AUFK), press edit, place the cursor on your field (AUFEX) and go to GoTo->Search help->for field
    But u should consider it'll mean to change a standard object for both cases: so u need to get the access key from your OSS.
    Max

Maybe you are looking for