Get record based on date time

HI
Im creating a site that generates leads. When a lead is
generated it will select a broker in the list based on certain
criteria. The thing i need to do is to select that broker which was
used the last.
There is a datetime field in my database which is used with
the createodbcdatetime function
How can i do this
Thanx
Carly

I am getting the following error
ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Expected 2.
Hint: The cause of this error is usually that your query
contains a reference to a field which does not exist. You should
verify that the fields included in your query exist and that you
have specified their names correctly.
My code is
SELECT b.brokerid, b.contactname
FROM broker b
WHERE b.dateandtimelastvisited = (SELECT
MIN(b1.dateandtimelastvisited)
FROM broker b
WHERE b1.brokerid = b.brokerid)
I have checked all the names and they are all correct

Similar Messages

  • Is it possible to get the updated table records based on date & time.

    Is it possible to get the updated table records based on date & time in oracle.
    Thanks in advance.

    no, actually i am asking update records using 'UPDATE
    or DELETE' statement, but not insert statement.
    Is it possible?
    I think we can do using trigger on table, but problem
    is if i am having 20 tables means i have to write 20
    trigger. i don't want like this.Of course it's still possible, typically you'll find applications with a column LAST_UPDATE, probably a LAST_UPDATED_BY and so on column. You don't say what your business need is, if you just want a one of query of updates to particular records and have a recent version of Oracle, then flashback query may well help, if you want to record update timestamps you either have to modify the table, or write some code to store your updates in an audit table somewhere.
    Niall Litchfield
    http://www.orawin.info/

  • Getting records based on date entered by the user

    Gurus,
    I have a valid to and valid from dates in ODS. The user is allowed to enter a date on the selection screen. If the user entered date lies in between Valid from and Valid to dates only these records need to be displayed in the report.
    E.g.
    ODS:
    Valid From                   Valid to                       Functional Area
    01/01/2009                  01/01/2099                             X
    01/01/2010                  01/01/2011                             Y
    01/01/2011                  01/01/2012                             Z
    User Entered Date: 01/02/2010
    Report Output:
    X
    Y
    How do i do this? Appreciate your immedite assistance.
    Thanks,
    Ravi Ananthuni

    Hi Ravi,
    You can do this by using cust exit, but that would affect the query performance adversely.
    I would suggest that you use condition in your report.
    Include Valid to and valid from dates in your report layout. Make 2 replacement path type formula variables on these 2 dates.
    And also the date you are entering in selection option, make it a formula variable ready for input.
    Now make a CKF. In the calculation write:  (user date > valid from)AND(user date <valid to)*1.
    And apply a condition to show only those rows where this CKF is 1.
    The replacement path variables will work only when you have those 2 dates in the report layout. If you don't wanna do that , you can make 2 date type KFs and use them directly in calculation.
    I hope this helps.
    Best Wishes,
    Mayank

  • How do I get the last changed date & time of a file in app server?

    Hi Experts,
    How do I get the last changed date & time of a file in app server?
    Thanks!
    - Anthony -

    Hi,
    that's what I use...
      CALL 'C_DIR_READ_FINISH'.             " just to be sure
      CALL 'C_DIR_READ_START' ID 'DIR' FIELD p_path.
      IF sy-subrc <> 0.
        EXIT. "Error
      ENDIF.
      DO.
        CLEAR l_srvfil.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD l_srvfil-type
          ID 'NAME'   FIELD l_srvfil-file
          ID 'LEN'    FIELD l_srvfil-size
          ID 'OWNER'  FIELD l_srvfil-owner
          ID 'MTIME'  FIELD l_mtime
          ID 'MODE'   FIELD l_srvfil-attri.
    *    l_srvfil-dir = p_path .
        IF sy-subrc = 1.
          EXIT.
        ENDIF." sy-subrc <> 0.
        PERFORM p_to_date_time_tz
          USING    l_mtime
          CHANGING l_srvfil-mod_time
                   l_srvfil-mod_date.
        TRANSLATE l_srvfil-type TO UPPER CASE.               "#EC TRANSLANG
        PERFORM translate_attribute CHANGING l_srvfil-attri.
        CHECK:
          NOT l_srvfil-file = '.',
          l_srvfil-type = 'D' OR
          l_srvfil-type = 'F' .
        APPEND l_srvfil TO lt_srvfil.
      ENDDO.
      CHECK NOT lt_srvfil IS INITIAL.
      pt_srvfil = lt_srvfil.
    FORM p_to_date_time_tz  USING    p_ptime  TYPE p
                            CHANGING p_time   TYPE syuzeit
                                     p_date   TYPE sydatum.
      DATA:
        l_abaptstamp TYPE timestamp,
        l_time       TYPE int4,
        l_opcode     TYPE x VALUE 3,
        l_abstamp    TYPE abstamp.
      l_time = p_ptime.
      CALL 'RstrDateConv'
        ID 'OPCODE' FIELD l_opcode
        ID 'TIMESTAMP' FIELD l_time
        ID 'ABAPSTAMP' FIELD l_abstamp.
      l_abaptstamp = l_abstamp.
      CONVERT TIME STAMP l_abaptstamp TIME ZONE sy-zonlo INTO DATE p_date
          TIME p_time.
    ENDFORM.                    " p_to_date_time_tz
    Regards,
    Clemens

  • Info record based on lead time

    How to create info record based on Lead time.
    If vendor supplies material with in 5 days cost will be 5 dollars each
    if he supplied after 5 days cost will be 3 dollars.
    how to control this function in info record or in Purchase order or in Conditions.
    Thanks
    SUNIL KUMAR

    closed

  • ABAP - HR : Need macro or FM to get record based on changed on date (AEDTM)

    Hi,
    I am having the requirement to get record which changed on yesterday (for sy-datum - 1). That means if record is updated today, by using rp_provide_from_last I will get today's record. But i should get yesterdays record.
    we can get this by using select or loop or provide - endprovide. Taking performance issue in consideration, this statements are not allowed.
    So please provide me any macro or function module which we can retrive the record based on AEDTM.
    I am using PNPCE LDB and i need to extract data for PA infotypes.
    Thanks in Advance,
    Ravi Kumar

    Hi Ravi,
    There is no macro which can retrieve the record based on AEDTM. One more thing to say is statement provide ...endprovide statement can be used and there would be no performance issue if i am not wrong. Anyway try this code.
    tables: pa0001, pernr.
    infotypes : 0001.
    data : begin of itab occurs 0,
           pernr like pa0001-pernr,
           aedtm like pa0001-aedtm,
           end of itab.
    data : v_aedtm type pa0001-aedtm.
    start-of-selection.
    v_aedtm = sy-datum - 1.
    get pernr.
    provide * from p0001 between pn-begda and pn-endda.
    if p0001-aedtm = v_aedtm.
    move : p0001-pernr to itab-pernr,
           p0001-aedtm to itab-aedtm.
           append itab.
    endif.
    endprovide.
    end-of-selection.
    loop at itab.
    write :/ itab-pernr, itab-aedtm.
    endloop.
    Regards,
    Kranthi

  • How to get Records based on time period?

    Hi,
    Iam having a Table which consists of two columns named "ID" (number datatype) and "JoinDate" (Varchar datatype). I would like to retrive the records whose join date is 3 months before. Any one pls give SQL for this scenario?
    Thanks in Advance...

    Why your joindate is varchar type? Which the sample data looks like? Is the format consistent?

  • Creating iCal entries based on date/time appearing in text on any app

    One thing I like about iCal's integration with Apple Mail is that the mail client is able to sense dates and times in email messages and then allow you to create iCal entries. But it seems that this date and time sensing is only limited to Apple Mail when technically users could potentially want to create iCal entries when a date and time appears on any app, such as on a web page in a web browser, in a PDF, or a word processing document. It seems logical then for iCal to be integrated with OS X's text services, so that at least if I highlighted a date and time, I could right click on it and bring up an option to create an iCal entry on based on that date and time.
    Does anyone know if this feature is natively supported (for which I have yet to enable), or is there a third party app out there that will allow me to do this?

    Just a quick update. I tried the first two -- text2cal and Calendar Creator -- and they don't seem to work on OS X 10.6.6.
    However, on another note, I found some discussion regarding Snow Leopard's enhanced data detectors being natively able to do what I've been looking for. But I just can't seem to get it to work on my computer:
    "Enhanced Data Detectors now link dates, times and other items found in text to actionable items in other applications, like iCal. For example, a drop-down menu that automatically appears when you select the time or date parts in a text enables you to create a new iCal event from a selected date or show the date in iCal." From this link: http://www.geek.com/articles/chips/5-cool-snow-leopard-features-that-apple-doesn t-want-you-to-see-yet-20090520/

  • Datalogging with options to retrieve subset of log file based on date/time

    I would like to thank this forum for useful advice so far in completing my LabVIEW software.
    I have a data logging challenge. I am supposed to log about 30 parameters every 5 seconds. Some of these parameters are digital (ON/OFF), some are values of speed (rpm) and others, an expression of a percentage (%). It should be possible in future to do a histogram or bar chart plot of some of the parameters, for a specific period range (say the last 5 minutes of a certain day). So in effect, do an extraction of a segment of the total log file.
    My challenge is if I use text file, like the one in the attached VI, can it give functionality of retrieving data (while the VI is running) from the log file, based on a certain time range (i.e. retrieve a section of the log file based on a certain date/time range, on demand)?
    The format in the text file is close to what I require, since it lists the time n one column and the other parameters on other columns to enable future histogram generation.
    Thanks a lot, friends.
    Solved!
    Go to Solution.
    Attachments:
    writer.vi ‏19 KB
    time.txt ‏1 KB

    Hey maxidivine,
    Iv been playing round with your code and found that to perform the search that you require could be quite demanding to system resources when scaled to the size of your application I shall try and find a way to perform the search using .txt files but the there are some other options available. I recommend the use if TDMS files as the file format is a very efficient, manageable method of data-logging. The TDMS file format is designed to write and read measured data at a very high speed, while maintaining a hierarchical system of descriptive information.
    Traditionally, TDMS was a National Instruments only file format – you could only read it using our products – LabVIEW/CVI/DIAdem. However, thanks to the popularity of the format, a bolt-on is now available for Excel, which allows you to directly open the .tdms files with Excel (see link).
    National Instruments Technical Data Management Overview
    http://zone.ni.com/devzone/cda/tut/p/id/3676
    Introduction to LabVIEW TDM Streaming Vis
    http://zone.ni.com/devzone/cda/tut/p/id/3539
    VI-Based API for Writing TDMS Files
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    TDM Excel Add-In Tool for Microsoft Excel User Guide
    http://zone.ni.com/devzone/cda/tut/p/id/4906
    TDM Excel Add-In for Microsoft Excel Download
    http://zone.ni.com/devzone/cda/epd/p/id/2944
    Troubleshooting the TDM Excel Add-In for Microsoft Excel 2000-2003
    http://zone.ni.com/devzone/cda/tut/p/id/5874
    Examples of the use of the TDMS API ship with LabVIEW. You will find them in HELP > find examples > fundamentals > File Input and Output. For you application, I would recommend the “Cont Acq&Graph Voltage - Write Data to File (TDMS).vi”.
    Furthermore, if you require some help with DIAdem, I would recommend clicking "getting started" from the DIAdem splash screen. This opens a manual which discusses everything from data analysis to report generation. Also, if you have DIAdem 11 or above, there are tutorial videos which install with DIAdem. These are useful little tutorials, which discuss all the DIAdem fundamentals. You can access these by selecting a particular palette tab (eg. report, view, analysis...etc) and then clicking the tutorial button (shown as a film strip with a question mark) at the top of the group view.
    Here are some more helpful DIAdem related resources for future reference.
    Report Gen in DIAdem...
    http://zone.ni.com/devzone/cda/tut/p/id/7379
    DataPlugins: Supported Data Formats (ni.com/dataplugins)
    http://zone.ni.com/devzone/cda/tut/p/id/4065
    Hope this is helpful
    Philip
    Philip
    Applications Engineer
    National Instruments
    UK Branch
    ===If this fixes your problem, mark as solution!===

  • Aperture 3.2: renaming based on date/time doesn't work properly

    While importing I rename my photos based on the date/time they were taken.
    In Aperture 3.1.3 this worked perfectly fine; for photos taken within the same second Aperture added an index number for the second, third etc. photo automatically.
    In Aperture 3.2 this doesn't work any longer; Aperture simply doesn't import photo number 2, 3 etc. of that particular one second.
    Note: I store the original files outside the aperture library, all run under snow leopard on an iMac i7. And as I said this worked fine under 3.1.
    Does anyone have an idea?

    Thanks all for the response
    Leonie, here are the details of what I do/experience:
    a) Aperture message after import
    b) I import pairs and rename them as follows “IMG_{Image Date}_{Image_Time}” (I know all the disadvantages of this but old habits are hard to break… and for me it still works fine)
    c) Difference of the images that are imported / not imported is solely the hundredth of the second when they were taken. Of my test series only the first image has been imported:
    DSC_4903.jpg(2011/10/19 22:49:50.08)
    DSC_4904.jpg(2011/10/19 22:49:50.25)
    DSC_4905.jpg(2011/10/19 22:49:50.43)
    DSC_4906.jpg(2011/10/19 22:49:50.60)
    DSC_4907.jpg(2011/10/19 22:49:50.80)
    d) I import via the import panel: Import in new project – storefiles in particular folder (not Aperture library) – subfolder ‘imageyear/month” – rename as described above – import both
    Doug, after some trial and error I agree with your thoughts, Aperture apparently simply lost its automatic indexes ‘-1’, ‘-2’ etc. and – what is good - doesn’t overwrite the first with the second and the third image... As you suggest there are different options to make the images unique. Most simple would be to add {index #} or {sequence #} or {counter}, all would do and I probably will choose one of them. Or I will downgrade back to 3.1.3 (do have backups) and wait until Apple fixes this.
    Kirby, turnoff “Don’t import duplicates” was a good idea but didn’t solve it. But your naming convention actually ensures the uniqueness of the files.
    Michael

  • Retrieve the records based on date where date is not stored

    Hi,
    I have one table in Oracle.
    I want to retrieve the records which are added or modified after a particular date & time.(but the table does not contain any column for date & time )
    For example: Product table(pid number,pname varchar2)
    i am entering 10 records on date 21/07/2005
    i am entering 20 records on date 22/07/2005
    i am entering 15 records on date 23/07/2005
    i am entering 30 records on date 24/07/2005
    If i want to retrieve the records added after 22/7/2005
    (ie.) last 45 records
    But the table does not contain any date field.
    How will you know date & time of each record updated in the table.
    If any one knows, help me.
    bye.

    for 9iR2: check out online document of Oracle9i Application Developer's Guide - Fundamentals and search flash back query
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg08sql.htm#10851
    for 10G, flash back feature is enhenced to whole database level, you can still use flash back query though.

  • Best way to create detail records based on data in the master record..

    Hi,
    I am using 11gr1p1 and ADF stack.
    I have a master detail relation between 2 records. I have EO and entity associations. I want to create a number detail records based on the data on the master record.
    For example
    I have a Stay Record which has begin and end date I need to create the DailyStay Record for each day for the range of begin and end date of StayRecord.
    Where should I do this? In EO implementation or in VO implementation.?
    Thanks

    Where should I do this? In EO implementation or in VO implementation.?If your child record should in no case be created without those default values, then EO.
    Otherwise, to increase reusability of your EO, then in the VO over the view link (i.e. other VO's would still be able to use your EO without having the child VO created with these defaults).
    This way your ViewObjects can also be used in a context where you don't want to copy from the masterFrank, If there's another UI flow that is so drastically different that it does not want things defaulted, then it probably needs a different VO altogether (on the same underlying EO though)

  • Select Records between Begin Date/Time and End Date/Time

    Hi, I need to select records from table GLPCA where the CPUDT and CPUTM are between a START DATE/TIME and END DATE/TIME. 
    I have the below logic from an SAP Solution, but it doesn't seem to be working right in my opinion.  It is picking up records earlier than the date ranges.  Can anyone tell me how I might be able to accomplish this?  I'm hoping this is an easy one for the ABAPPERs... 
    Thanks,
    START DATE 20091022
    START TIME 125736
    END DATE 20091022
    END TIME 135044
    CPUDT 20091022
    CPUTM 100257
          SELECT * FROM GLPCA
             WHERE ( CPUDT >= STARTDATE AND ( CPUTM >= STARTTIME OR ( CPUDT <= ENDDATE AND CPUTM <= ENDTIME ) ) ).

    Thank you all!  I ended up using the following:
    SELECT * FROM GLPCA
              WHERE RYEAR IN L_R_RYEAR
                AND ( ( CPUDT = STARTDATE AND CPUTM >= STARTTIME ) OR CPUDT > STARTDATE )
                AND ( ( CPUDT = ENDDATE   AND CPUTM <= ENDTIME )   OR CPUDT < ENDDATE ).
    This child was born from the following thread that was found:
    update date and time of client record

  • Deleting records based on date with timestamp

    Hi there,
    In continuation from my earlier Query. Multiple reccord have inadvertantly been inserted in the LOAN_TXN table. I want to delete all the records, except one, based on date with timestamp.
    CREATE TABLE LOAN_TXN
    TXN_DATE                     DATE,
    BALANCE          NUMBER(10,2),
    CODE          VARCHAR2(1),
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '02/15/2010 11:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'), 250000, 'D');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2010 11:59:59 AM', 'MM/DD/YYYY HH:MI:SS AM'), 250000, 'B');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '05/14/2010 11:25:00 AM', 'MM/DD/YYYY HH:MI:SS AM'), 500000, 'D');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '06/30/2010 12:15:00 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '08/02/2010 10:45:26 AM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '09/08/2010 02:10:17 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '10/27/2010 04:25:20 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '11/09/2010 10:15:55 AM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '12/29/2010 03:10:20 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '01/12/2011 01:11:15 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '02/11/2011 12:11:48 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2011 11:59:59 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2011 11:59:59 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2011 11:59:59 PM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2011 11:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'), 4000, 'R');
    INSERT INTO LOAN_TXN ( TXN_DATE, BALANCE, CODE) VALUES (TO_Date( '03/31/2011 11:59:59 AM', 'MM/DD/YYYY HH:MI:SS AM'), 460000, 'B');I want to delete mutiple records, except one, with code 'R' and TXN_DATE = '03/31/2011 11:59:59 PM' How do I do that ?

    user3308033 wrote:
    I think your query would delete all the duplicate records. Keeping one, I just want to delete mutiple records with timestamp : 11:59:59.
    DELETE FROM loan_txn
    WHERE rowid != (
                     SELECT  MIN(rowid)
                       FROM  loan_txn
                       WHERE txn_date = TO_DATE('03/31/2011 11:59:59 PM','MM/DD/YYYY HH:MI:SS AM')
                         AND code = 'R'
        AND txn_date = TO_DATE('03/31/2011 11:59:59 PM','MM/DD/YYYY HH:MI:SS AM')
        AND code = 'R'
    /SY.

  • How to get Client(browser) current date/time in BIP report

    Hi,
    I need to display report generated date in BIP report and this should be client(browser) current date/time. I tried the following things.
    1. have used MS Word Native Date/time using Insert->Date/Time. And we have chosen the M/d/yyyy h:mm:ss am/pm format. but it is printing BIp server date/time, not client date/time.
    2. <?xdofx:sysdate?>, <?xdoxslt:sysdate_as_xsdformat()?> and <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME'?> are giving GMT Date/Time, but we need client Date/Time.
    3.<?xdoxslt:sysdate('DD-MON-YYYY HH12:mi:ss')?> is giving the system date/time of the machine where BIP server is installed.
    Could you provide some help in this??
    Thanks
    Hari

    Hello, Hari,
    what would return something like this:
    Execution date:
    <?xdoxslt:current_date('ja-JP', 'Asia/Tokyo')?>
    <?xdoxslt:current_time('ja-JP', 'Asia/Tokyo')?>
    @Vetsrini,
    for my opinion,
    in the countries where time is switching (winter/summer) using the hard coded time zones in the format-date() cause a problem:
    for example:
    if we enter the date in date prompt in summer it will return PM_DT = 2010-07-20T00:00:00.000+04:00
    in winter 2010-07-20T00:00:00.000+03:00, so,
    using <?format-date:PM_DT;'DD.MM.YYYY';'GMT+3'?> return 2010-07-20 in winter and 2010-07-19 in summer.
    regards,
    Eldar A.

Maybe you are looking for