Search by date range

This should be simple but I cannot get it to work. Trying to
construct a page where the user enters a start date & an end
date & we display results.
I am using :
SELECT *
FROM AVRmonth
WHERE ExpiryDate BETWEEN #varStart# AND #varEnd#
In the Variables editor I have:
varStart % Request("startFld")
varEnd % Request("endFld")
This fails to work, DW gives the error of "Syntax error in
query expression 'ExpiryDate BETWEEN #%# AND #%#
If I change default values to be a date, eg: #1/1/04 DW gives
no error but query does not work
If I use no variables but just use :
SELECT *
FROM AVRmonth
WHERE ExpiryDate BETWEEN #01/01/04# AND #01/06/05#
It works & displays results from that date range.
I think I have tried all combinations of using # ' to
surround variable names but still no joy.
I am sure this is something blindingly obvious but I cannot
see it.
Can anyone please help...........
This is using MS Access 2000 database

You could use this and all you need to change is the
MM_NAMEOFYOURCONNECTION_STRING, look for the Dim
MM_YOURCONNECTION_STRING in the connections folder, but this should
work.add the <!--#include file="Connections/YOURCONN.asp" -->
from the top of your page. You can make this recordset from the
advanced button in the recordset creation wizard, there is a good
tutorial on adobes site also search for 'dreamweaver multiple
paramter query' for other tutorials
http://www.adobe.com/support/ultradev/building/multiple_param_search/multiple_param_search 02.html
<%
Dim rsFriday__MMstart
rsFriday__MMstart = "1"
If (Request.Form("strtFld") <> "") Then
rsFriday__MMstart = Request.Form("strtFld")
End If
%>
<%
Dim rsFriday__MMend
rsFriday__MMend = "1"
If (Request.Form("strtFld") <> "") Then
rsFriday__MMColParam = Request.Form("endFld")
End If
%>
<%
Dim rsFriday
Dim rsFriday_cmd
Dim rsFriday_numRows
Set rsFriday_cmd = Server.CreateObject ("ADODB.Command")
rsFriday_cmd.ActiveConnection =
MM_NAMEOFYOURCONNECTION_STRING
rsFriday_cmd.CommandText = "SELECT * FROM AVRmonth WHERE
ExpiryDate BETWEEN ? AND ?"
rsFriday_cmd.Prepared = true
rsFriday_cmd.Parameters.Append
rsFriday_cmd.CreateParameter("param1", 135, 1, -1,
rsFriday__MMstart) ' adDBTimeStamp
rsFriday_cmd.Parameters.Append
rsFriday_cmd.CreateParameter("param1", 135, 1, -1, rsFriday__MMend)
' adDBTimeStamp
Set rsFriday = rsFriday_cmd.Execute
rsFriday_numRows = 0
%>
put this at end of page after </body> </html>
tags;
<%
rsFriday.Close()
Set rsFriday = Nothing
%>

Similar Messages

  • EasyDMS - search by date range for characteristics of type date

    Hi Folks,
    I have a characteristic of type date in the additional data of a DMS document. If I enter the date (for example validity date) as 08/31/2009 and search using cv04n and give a date range for the characteristic (i.e. 01/01/2009 - 12/31/2009), the search result will bring up the document.
    However, I cannot do this from the EasyDMS find function. I need to specify an exact date. This is not very helpful for user who need to find documents with a validity date between 01/01/2009 - 12/31/2009 for example. Is there a way users can search for date range in EasyDMS find function?
    Thanks,
    Lashan

    To search a date range with EasyDMS Client you have to set the registry key
    \HKEY_CURRENT_USER\Software\SAP\EasyDms\Generel\DateSearchPick to Value 0
    Then you can use the input field like in SAP-Gui. (01.01.2009-31.01.2009)
    If you set the value to 1 or the key is not defined you can only search for one specified date.
    If you don't find this key on your PC create it as dword.
    Maybe you must restart you PC for takeing effect.
    Hope this will help you.
    Regards Wolfgang

  • Searching on date ranges in classification

    Goodday All,
    I'm trying to search on date range within classification.
    I have a classification field 'Next Review Date'. It has been setup as date format.
    Does anyone have any idea how to search on a date range? For example 01.01.2011 to 01.02.2011
    Any help would be appreciated

    Hi Neil
    Hope the following steps will give the workaround solution to solve the problem
    1a.  Create the characteristic field 'Next Review Date'.
    1b.  In Basic data tab-->Value Assignment :  Tick mark Multiple Values & Interval Values.
    1c.  In Values Tab enter the date ranges that you need to define
              For Example:
                                  01.05.2011 - 30.05.2011
                                  01.06.2011 - 30.06.2011
                                  01.07.2011 - 30.07.2011
                                  01.08.2011 - 30.08.2011
    1d. Save it.
    2a. Assign the characteristic to the class.
    3a. Go to CV01n.
    3b. In Additional Data tab, you can view the characteristic field that you have defined. For example 'Next Review Dateu2019
    3c. Now you can enter any interval values between the dates that you defined for the characteristics.
          For example 10.05.2011 / 20.06.2011 / 25.07.2011 / 30.08.2011 or any value between the range. (If the value is not  
          between the range (ex: 10.12.2011) then the system will throw the error.
    3d. Save the DIR.
    4a. Go to Cv04n>Classification Tab> Press 'F4' key on the characteristic. Now you can select the interval and search the required documents.
    Harris.

  • Searching Date Ranges

    Can you do a search on date ranges in the contains clause? I am using USER DATASTORE so I am able to store alot of information under one index. Included in this information is the date a record was entered. I would like to have the ability to search on a range of entery dates.

    Hi Neil
    Hope the following steps will give the workaround solution to solve the problem
    1a.  Create the characteristic field 'Next Review Date'.
    1b.  In Basic data tab-->Value Assignment :  Tick mark Multiple Values & Interval Values.
    1c.  In Values Tab enter the date ranges that you need to define
              For Example:
                                  01.05.2011 - 30.05.2011
                                  01.06.2011 - 30.06.2011
                                  01.07.2011 - 30.07.2011
                                  01.08.2011 - 30.08.2011
    1d. Save it.
    2a. Assign the characteristic to the class.
    3a. Go to CV01n.
    3b. In Additional Data tab, you can view the characteristic field that you have defined. For example 'Next Review Dateu2019
    3c. Now you can enter any interval values between the dates that you defined for the characteristics.
          For example 10.05.2011 / 20.06.2011 / 25.07.2011 / 30.08.2011 or any value between the range. (If the value is not  
          between the range (ex: 10.12.2011) then the system will throw the error.
    3d. Save the DIR.
    4a. Go to Cv04n>Classification Tab> Press 'F4' key on the characteristic. Now you can select the interval and search the required documents.
    Harris.

  • Using QUERY_FIND by date range EBS-R12

       HI ,
    I have developed a custom form for EBS R12, and i used the standard technique to develop it,
    I also used the QUERY_FIND object group to display search form. using below code in the pre-query trigger of the block
    BEGIN
       IF :parameter.g_query_find = 'TRUE'
       THEN
          COPY (:query_find.item,
                'my_block.item'
          :parameter.g_query_find := 'FALSE';
       END IF;
    END;
    and everything is working fine.
    but now i need to search for a DATE item, and the search should be by Date From and Date  to.
    I can't use the copy function to do the search for date range.
    so i want to know the standard way that I should use to do such search.
    I thought to used SET_BLOCK_PROPERTY and change the DEFAULT_WHERE
    is this a standard way to do this search, or there is other way to do that.
    Best Regards
    Amir

    Hi,
    Try something like this:
    SELECT       grad_stu_id
    FROM       grad_fee_structure_hist
    GROUP BY  grad_stu_id
    HAVING       COUNT ( CASE
                      WHEN  DATE '2010-09-01'  BETWEEN  grad_eff_fee_date
                                               AND        grad_exp_fee_date
                    THEN  1
                END
              )     > 0
    AND       COUNT ( CASE
                      WHEN  DATE '2009-09-01'  BETWEEN  grad_eff_fee_date
                                               AND        grad_exp_fee_date
                    THEN  1
                END
              )     = 0
    ;If a NULL grad_fee_exp_date means that the row is currently in force, then use something like
    NVL ( grad_fee_exp_date
        , DATE '9999-12-31'
        )instead of the raw date.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data. Explain how you get those results from that data, giving specific examples.
    Always say what version of Oracle you're using.
    Edited by: Frank Kulash on Sep 13, 2010 11:08 AM
    Changed date comparisons to BETWEEN.

  • Multi Mailbox Search Date Range Results Inaccurate

    Hi All,
    I have an Exchange 2010 server with SP3 /RU3 installed. When I do a multi mailbox search using OWA /ECP and put in a start and end date from the Date Range dropdown box, my search results shows me more than just the intended date range of emails. For
    example; if I request just a particular month and year, my results will show a couple of years worth of emails not just the one month that I requested.
    If I do the same exact search using PowerShell command the results are accurate, they will show only the one month. We could use PowerShell commands but we'd would rather use the OWA /ECP console instead. To me it seems like a bug in the code. Has anyone
    else experience this issue or have a resolution?
    Thanks in advance.
    LJC321

    Possibly, this could be BUG.
    Haven't experience this kind of issue...
    Cheers,
    Gulab Prasad
    Technology Consultant
    My Blog:
    Exchange Ranger
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Neen help with date range searches for Table Sources

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 24-MAR-07, 22-SEP-), 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Need help with date range searches for Table Sources in SES

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 10-MAR-07, 22-SEP-07, 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks very much, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • How do I change the default "date range" when searching in the forums?

    Hi all,
    New to the SAP forums...  How do I change the default date range when searching in the forums?  I am getting a 90 day search by default.  Then I have to change it and search again.  Argh!
    Thanks,
    --Amy Smith

    Hi Amy,
    the default date range cannot be changed by users. It is defined system-wide.
    Regards,
    Michael

  • Regarding date ranges in search criteria in oracle forms

    I am using employee number,name, person type, and date ranges as search criteria in custom form.
    when I enter employee number, hit the find button, I am getting the exact info in the result block.
    Result block contains
    employee name,personid,emp numb,org,start_date.
    Similarly when I enter employee number,dept, I am getting correct values.
    My question here is, when I enter date range. Iam unable to filter data.
    When i enter START_DATE between nvl(:BLOCKNAME.START_DATE,'01-JAN-1901') and nvl(:BLOCKNAME.END_DATE,'31-DEC-4712') at where clause in the result block. I got data for the date range also.
    if I give condition in the where clause, results are taking so much time when i search with employee name,number,dept,person type.
    If i query with date, persormance is good.
    Do u any know,how to prevent START_DATE between nvl(:BLOCKNAME.START_DATE,'01-JAN-1901') and nvl(:BLOCKNAME.END_DATE,'31-DEC-4712') when we search with employee name,number,dept,person type.

    Initailly Ididnt given any code in the where clause of the result block. I got data in the result block when i search with employee name,number,person type,dept etc except date range.
    If i give date range, irrespective of the date, getting all the data.
    after that i added code to the where clause of the result block. Now i am getting data for everything.
    like, when i query with employee name,number,even date range also.
    My question here, performance.
    when I query with date range, data is coming in expected time in the result block.
    when i query with dept, taking much time since date range logic exist in the where clause of the result block.
    I need to restrict the where clause only to the data ranges. Where clause should not necessary for employee number,name,person type dept search criteria
    Tahnks for your reply

  • Date range searches - not working

    Whenever I use a date range on a OTN forum search, the results are not what I expected them to be. For example I did a search for JUnit within a timefram of 30 days and my own posts don't show up.
    Is this a known issue?

    As usual no response...

  • Issue with Date Range Search

    Hi, I am doing a search on a table using a date column having index defined on it.
    when I am using below query:[Here 26-OCT-2010 is the current date.]
    SELECT *
    FROM cs_incidents_all_b
    WHERE incident_date BETWEEN TO_DATE ('25-OCT-2010 00:00:00',
    'DD-MON-RRRR HH24:MI:SS'
    AND TO_DATE ('26-OCT-2010 23:59:59',
    'DD-MON-RRRR HH24:MI:SS'
    Explain plan statistics is - Cost : 4, Bytes: 559, Cardinality:1
    If I run the same query by changing the dates and with 1 day duration, the cost is increasing significantly:
    SELECT *
    FROM cs_incidents_all_b
    WHERE incident_date BETWEEN TO_DATE ('01-OCT-2010 00:00:00',
    'DD-MON-RRRR HH24:MI:SS'
    AND TO_DATE ('02-OCT-2010 23:59:59',
    'DD-MON-RRRR HH24:MI:SS'
    Explain plan statistics is - Cost : 3,643, Bytes: 2,217,553, Cardinality:3,967
    And if I increase the date range, the cost is becoming too high.
    If anybody faced this proble previously, kindly help me to resolve.
    Thanks in advance,
    Sam.

    Tuning request
    Take a look at the
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting

  • Searching by a single date or date range.

    I would like to be able to search by a single date, @StartDate, or by a date range , between @StartDate and @EndDate. I am having a hard time with the logic on this for a report in SSRS.

    Hi MJohnson629,
    According to your description, you want to use @StartDate and @Enddate parameters to filter report, right?
    In your scenario, you could create two report parameters (@StartDate and @Enddate), then specify a filter as date field between @StartDate and @Enddate in main dataset. Please refer to steps below:
    1. Create two parameters, select the Date/Time for Data type. You could specify the date field as available values or not give available values.
    2. In main dataset, specify the filter like below:
    3. Preview the report, select values for parameters.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Increasing the date range in generic search

    Hello,
    Is there an easy way to increase the date range in generic search to more than 1 year (the last year option in the dropdown)?
    Our release is ecommerce 7.
    Many thanks
    Stefan

    Check if the BAPI is able to give results for more than a year. If thats possible, add new select options to the jsp of the search view.

  • Defining Date range and using the same range to search the documents.

    Hi Sap Gurus,
    in our business there are some documents which do have Validity period, like say Inspection certificates and valid for say 10 months, ex..  JAN 25th 2009 to Oct 24th 2009
    we store this certificate in DMS and link to some SAP object say an Asset,
    we have a requirement to list all the documents based on the expiry date range. say to get a list of documents which are about to expire in 15 days, or the list of documents which have already expired
    I tried to define a characteristic in date format, but it is a single value field, and search is only supported on that specific value only.
    like we cannot serch the DIR falling in between this Date Ranges.
    also report of Documents which are to expire in 15 days could not be got.
    is there a way to meet this requirement , if it is through a development also please tell me how the logic could be built
    Thanks and regards
    Priya S

    Hi SAP Gurus,
    Thanks much Thomas for your Promt reply.
    The solution provided by Thomas really works but the same thing is not possible in EDMS,
    in Easy DMS we cannot manually give any value in the date characteristics field, the system will ask to fill from the date window format.
    so we cannot enter < or > <> value in characteristics, hope there is any note or other procedure to get the same funtionality.
    please if any one worked on the same with EDMS  let me know
    Thanks and kind regards
    Priya S

Maybe you are looking for