Query not giving me the output I want

Hi there,
I have the following query:
select rent_no, rent_end, count(*) as "NUMBER OF DRIVERS"
from rental where (rent_end IS NOT NULL) AND (rent_end between (select to_date(sysdate) from dual) and (select to_date(sysdate-7) from dual))
group by rent_no, rent_end
order by rent_end;
but it's not outputting my desired output. Basically, I want to view the selected columns where the RENT_END value is in the last seven days. So my output is supposed to look something like this:
RENT_NO RENT_END NUMBER OF DRIVERS
12345679 07-OCT-09 1
As you can see, the rent_end value is within the last seven days, but for some reason, it's not outputting at all. can anyone help?

I have a couple of recommendations:
select to_date(sysdate) from dualSYSDATE is already a date value, there is no need to use TO_DATE() to convert it to a date. In addition, you can just replace the whole select statement with SYSDATE.
rent_end between (select to_date(sysdate) from dual) and (select to_date(sysdate-7) from dual)This is probably the main reason why your query is not returning any rows. The BETWEEN is not setup correctly. It should be this:
BETWEEN <LOWER BOUND> AND <UPPER BOUND>However, you have yours flipped backwards. It should probably be:
RENT_END BETWEEN TRUNC(SYSDATE) - 7 AND TRUNC(SYSDATE+1) - 1/86400 /* 23:59:59 on the current day */HTH!

Similar Messages

  • HT204312 I-tunes taking my money and not giving me the song i wanted?

    I downloaded a song off the store and it didn't download until the 3rd time. It took 2.58 of mine without downloading the song. How can i get the 2.58 back onto my account? The song was Smalltown boy by BronskiBeat.

    Click here and ask the iTunes Store staff for a refund. If a credit card got charged, you can also contact the card's issuer and dispute it.
    (125261)

  • I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    Question
    I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    To be more precise, you can setup a JComponent or JPanel on top of your JavaFX nodes that has a TransferHandler that can convert the (AWT/Swing) images dragged to the app to JavaFX image and then insert it into the underlying node.
    As for the file chooser itselft: ListView and the JavaFX composer can allow you to create one quite easily. TreeView can aslso be used to a lesser extend (still a big buggy). For both of these, there are small bugs in the Cell API that may (or may not) prevent from displaying a proper thumbnail in the cells.
    You can also use a regular JFileChooser if you do not mind the dialog box having a different LnF from the rest of your application.

  • When converting a PDF document to word, the word count feature is not giving me the number of words

    I have been using Acrobat for converting PDF documents to Word.  It had been working just fine, but lately, when I convert a PDF document to Word, it is not giving me the word count, which is why I subscribed in the first place. Someone has any idea of why?

    Hi Robin,
    I would recommend you to use Acrobat software to convert this pdf file, Acrobat software enable you to customize the conversion settings.
    You can download a free 30-day trial from this Link : https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    After downloading and installing acrobat, Open pdf file in Acrobat, go to File menu -> Click 'save as other' -> Microsoft Word -> Word Document.
    A pop-up window will appear that would prompt you to choose the file to be converted, after you select the file, click on the settings button on the bottom left of the pop-up window and choose 'Retain Page layout' under layout settings, click ok and then save.
    Hope that helps with your query.
    Regards,
    Rahul

  • FINAL EXPORT / MIXDOWN FONCTION does not work. The Output Wave Resulting is a total silence?

    AUDITION FINAL EXPORT / MIXDOWN FONCTION does NOT ever work
    The Output Wave Resulting is a TOTAL SILENCE - NO SOUND AT ALL
    Bought & registered Program act as an expired DEMO...
    The result is a wave with a completely flat HORIZONTAL LINE of pure $300.00 rip off of SILENCE
    Even after many clean reinstallations AUDITION never is able to do a Final Mixdown with any Sound in it.
    A AUDITION Support Technician cleaned up during 1 hour about 15 secret hidden Adobe files in the Windows XP System.
    After this clean up the AUDITION program functionned ONCE! Once it was able to output a Final Mixdown with sound in it.
    That never occured again after. I have a very standard very well maintained Windows XP computer.
    My understanding & the experience with the Adobe Support Technician prooves that the problem is the deeply hidden spy files of Adobe who erroneously turn my bought & registered program into an expired DEMO. I have reported the problem numerous times to Adobe, & everytime I talk to support people at Adobe, they tell me they have never heard about this problem, when I already had reported it MANY times at the Adobe Tech Support department !!!
    I can only draw the conclusion Adobe is trying to hide this problem away by pretending they have never heard about it.. ?
    Anybody have had a similar AUDITION  / DEPRESSION nightmare & found a solution ?

    Astraelia wrote:
    Audition is the first & only program easely accessible for musicians who record themselves without having the expertise of a sound technician handling the recording operations. This is certainly by far, the greatest quality of Audition.
    I would term Audition to be the very first & only recording program (on PC) conceived for musicians. All the others Audio Logic, Q Base ect. are conceived for professionnal recording engineers.
    You seem to have a rather strange conception of Audition, I must say. Most musicians want it to do rather more than it does. It wasn't conceived for musicians at all really - it was originally designed to be just an editor, to which the functions of a multitrack tape recorder were added. Its primary use is professional - always has been, mainly by radio stations. Just about every station in the world has at least one copy, and some larger ones like the BBC have rather a lot more... and I'd say that it was the likes of Cubase and Logic that are conceived for musicians, not Audition. It's also used by a lot of Mastering studios, even though they won't admit it. The primary reason for it being in Adobe's Creative Suite is because it's getting more and more integrated with the video programs in it - nothing to do with music at all.
    I'm afraid that whether you like it or not, Audition is marketed towards people who do know what they're doing, by and large. That's why it behaves the way it does, and why you do really need to be at least a bit of a technician to use it effectively. And I'm still trying to think whether I know of any guitarists at all who use amplifiers and who don't understand at least the basics of how a mixer works, but I'm afraid that I can't think of any. I'm not going to say that it's common knowledge, but I don't think it's that rare either.

  • Reg : data is not getting in the output

    hi team,
                 data is not getting in the  output, but it is getting in the debug mode
    REPORT ZSAPP10 .
    *tables : pernr.
    TABLES : PA0001.
    type-pools : slis.
    types : begin of itab,
            pernr type pernr,
            orgeh type orgeh,
            abkrs type abkrs,
            end of itab,
            begin of itab2,
            pernr type pernr,
            vorna type pad_vorna,
            nachn type pad_nachn,
            end of itab2.
    parameter : p_pernr like pa0001-pernr.
    *DATA:  g_cprog  tYPE SY-CPROG.
    data : i_itab1 type table of itab initial size 0,
           i_itab2 type table of itab2 initial size 0.
    data : w_itab type itab,
           w_itab2 type itab2.
    data : t_fieldcat type slis_t_fieldcat_alv,
            w_fieldcat type slis_fieldcat_alv.
    data : t_event type slis_t_event,
            w_event type slis_alv_event.
    data : t_listheader type slis_t_listheader,
           w_listheader type slis_listheader.
    *get pernr.
    w_event-form = 'TOP_OF_PAGE'.
    w_event-form = 'sub1'.
    append w_event to t_event.
    w_listheader-typ = 'H'.
    w_listheader-info = 'this is new top of page'.
    append w_listheader to t_listheader.
    select pernr
           orgeh
           abkrs from pa0001 into table i_itab1 where pernr = p_pernr.
    w_fieldcat-col_pos = 1.
    w_fieldcat-seltext_m = 'personnal no'.
    w_fieldcat-fieldname = 'pernr'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    w_fieldcat-col_pos = 2.
    w_fieldcat-seltext_m = 'org. unit'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-fieldname = 'orgeh'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    w_fieldcat-col_pos = 3.
    w_fieldcat-seltext_m = 'payroll area'.
    w_fieldcat-tabname = 'i_itab1'.
    w_fieldcat-fieldname = 'abkrs'.
    w_fieldcat-outputlen = '20'.
    append w_fieldcat to t_fieldcat.
    *g_cprog = SY-CPROG.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
               I_INTERFACE_CHECK                 = ' '
               I_BYPASSING_BUFFER                =
               I_BUFFER_ACTIVE                   = ' '
                 I_CALLBACK_PROGRAM                = SY-CPROG
               I_CALLBACK_PF_STATUS_SET          = ' '
               I_CALLBACK_USER_COMMAND           = ' '
               I_CALLBACK_TOP_OF_PAGE            = ' '
               I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
               I_CALLBACK_HTML_END_OF_LIST       = ' '
               I_STRUCTURE_NAME                  =
               I_BACKGROUND_ID                   = ' '
               I_GRID_TITLE                      =
               I_GRID_SETTINGS                   =
               IS_LAYOUT                         =
                 IT_FIELDCAT                       = T_FIELDCAT
               IT_EXCLUDING                      =
               IT_SPECIAL_GROUPS                 =
               IT_SORT                           =
               IT_FILTER                         =
               IS_SEL_HIDE                       =
               I_DEFAULT                         = 'X'
               I_SAVE                            = ' '
               IS_VARIANT                        =
                 IT_EVENTS                         = T_EVENT
               IT_EVENT_EXIT                     =
               IS_PRINT                          =
               IS_REPREP_ID                      =
               I_SCREEN_START_COLUMN             = 0
               I_SCREEN_START_LINE               = 0
               I_SCREEN_END_COLUMN               = 0
               I_SCREEN_END_LINE                 = 0
               IT_ALV_GRAPHICS                   =
               IT_ADD_FIELDCAT                   =
               IT_HYPERLINK                      =
               I_HTML_HEIGHT_TOP                 =
               I_HTML_HEIGHT_END                 =
               IT_EXCEPT_QINFO                   =
             IMPORTING
               E_EXIT_CAUSED_BY_CALLER           =
               ES_EXIT_CAUSED_BY_USER            =
                 TABLES
                 T_OUTTAB                          = I_ITAB1[]
              EXCEPTIONS
                PROGRAM_ERROR                     = 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.
          FORM sub1                                                     *
    FORM sub1.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = t_listheader
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    ENDFORM.                                                    " sub1

    write this way...
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
            i_callback_program                = w_repid
            is_layout                = wa_layout
            i_callback_user_command  = 'USER_COMMAND_ACCT'
            i_grid_title             = 'Document Status Report'
             it_fieldcat                       = it_fcat[]
         IT_SORT                        = IT_SORT[]
             it_events                = it_events
             TABLES
               t_outtab                        = it_final_data[]
          EXCEPTIONS
            program_error                     = 1
            OTHERS                            = 2.

  • I'm setting up Apple ids, and its not giving me the option to set up a rescue email. How can I add one?

    I'm setting up Apple IDs, and its not giving me the option to set up a rescue email. I've set up Apple ID's in the past, and its always given me the option. How can I add a rescue email?

    You can find the instructions here. I removed the screenshots but the text is copied below.
    http://support.apple.com/kb/HT5312?viewlocale=en_US&locale=en_US
    You can edit or delete your rescue email address at My Apple ID. To edit your rescue email address:
    Navigate to My Apple ID using your web browser.
    Click "Manage your account"
    When prompted, sign in using your Apple ID and password.
    Click Password & Security
    You'll be asked to answer 2 of your 3 security questions before you can make any modifications. If you are unable to remember your answers, you can choose to send an email to your rescue email to reset your security questions.
    Note: The option to send an email to reset your security questions and answers will not be available if a rescue email address is not provided. You will need to contact iTunes Store support in order to do so. 
    After you've validated your identity by correctly answering your security questions, click Edit to the right of your rescue email address.
    Once you've finished editing your rescue email address, click the Save button directly below the email field.  

  • I havent upgraded my iphone 4 to ios 4.3. Now when i try to back up in itunes, it doesnt recognise my iphone, but sees it as a camera, not giving me the links i need to back up. I have removed itunes completely and downloaded it new.

    i havent upgraded my iphone 4 to ios 4.3. Now when i try to back up in itunes, it doesnt recognise my iphone, but sees it as a camera, not giving me the links i need to back up. I have removed itunes completely and downloaded it new.

    What computer OS are you using. Here are links for iTunes not recognizing the iPhone in different OS.
    Apple:  http://support.apple.com/kb/TS1591
    Windows:  http://support.apple.com/kb/TS1538

  • Added in to fieldcat but do not display in the output

    Dear Experts,
    I meet a problem that I add one recode into the fieldcat.But in output, the field's name do not appear in the output.The following is my code.The content 'Duodate' does not appear on the screen.
    form fieldcat_init using l_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
    *head field categories                                       *
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'LIFNR'.
      ls_fieldcat-tabname   = 'ITAB_HD_IT'.
      ls_fieldcat-seltext_l = 'Vonder'.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
    ls_fieldcat-outputlen = 12.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'NAME1'.
      ls_fieldcat-tabname   = 'ITAB_HD_IT'.
      ls_fieldcat-seltext_l = 'Vonder'.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      ls_fieldcat-outputlen = 40.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'VBLNR'.
      ls_fieldcat-tabname   = 'ITAB_HD_IT'.
      ls_fieldcat-seltext_l = 'Payment'.
    ls_fieldcat-outputlen = 10.
      ls_fieldcat-do_sum = 'X'.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'WAERS'.
      ls_fieldcat-tabname   = 'ITAB_HD_IT'.
      ls_fieldcat-seltext_l = 'CURR.'.
    ls_fieldcat-outputlen = 10.
      ls_fieldcat-do_sum = 'X'.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'WRBTR'.
      ls_fieldcat-tabname   = 'ITAB_HD_IT'.
      ls_fieldcat-seltext_l = 'Amount'.
      ls_fieldcat-outputlen = 15.
      ls_fieldcat-do_sum = 'X'.
      append ls_fieldcat to l_fieldcat.
    *item field categories                                       *
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'BELNR'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Docu.'.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      ls_fieldcat-outputlen = 12.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'BLDAT'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Document Date'.
      ls_fieldcat-outputlen = 10.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'ZFBDT'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'BasDte'.
      ls_fieldcat-outputlen = 10.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      append ls_fieldcat to l_fieldcat.
        clear ls_fieldcat.
      ls_fieldcat-fieldname = 'ZDUED'.
      ls_fieldcat-tabname   = 'ITAB_ITEM-IT'.
      ls_fieldcat-seltext_l = 'DueDate'.
      ls_fieldcat-outputlen = 10.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'ZTERM'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Cond'.
      ls_fieldcat-outputlen = 4.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'ZPAYT'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Pmnt term'.
      ls_fieldcat-outputlen = 12.
      ls_fieldcat-key       = 'X'.
      ls_fieldcat-fix_column     = 'X'.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'WAERS'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Currency'.
      ls_fieldcat-outputlen = 4.
      append ls_fieldcat to l_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname = 'WRBTR'.
      ls_fieldcat-tabname   = 'ITAB_ITEM_IT'.
      ls_fieldcat-seltext_l = 'Amount'.
      ls_fieldcat-outputlen = 15.
      append ls_fieldcat to l_fieldcat.
    ENDFORM.                    " FIELDCAT_INIT

    hi,
    try this code.
    ls_fieldcat-fieldname = 'LIFNR'.
    ls_fieldcat-seltext_l = 'Vonder'.
      ls_fieldcat-key = 'X'.
      ls_fieldcat-fix_column = 'X'.
       ls_fieldcat-outputlen = 12.
      append ls_fieldcat to l_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         IT_FIELDCAT                        = l_fieldcat.  " Pass the fielc cat here
    it must work.... and check out thels_fieldcat-fieldname  again.. you have to give the correct fielname in uppercase inside ' '.
    thankyou.

  • My daughter has somehow figured out how to register for her own Apple ID but is very underage. She is not giving me the correct info for me to get into her email. She has downloaded some apps that I would not allow. How can I recover her Apple ID info?

    My daughter has somehow figured out how to register for her own Apple ID but she is very underage. She is not giving me the correct info for me to get into her email. She has downloaded some apps that I would not allow. How can I recover her Apple ID info?

    No it's not stealing. They have an allowance that you can share with so many computers/devices. You'll have to authorize her computer to play/use anything bought on your acct. You can do this under the Store menu at top when iTunes is open on her computer.
    As far as getting it all on her computer....I think but I am not sure (because I don't use the feature) but I think if you turn on Home Sharing in iTunes it may copy the music to her computer. I don't know maybe it just streams it. If nothing else you can sign into your acct on her computer and download it all to her computer from the cloud. Not sure exactly how to go about that, I haven't had to do that yet. I wonder if once you authorize her computer and then set it up for automatic downloads (under Edit>Preferences>Store) if everything would download. Sorry I'm not much help on that.

  • EE wifi Not giving me the option to set up on a galaxy s6?

    i just bought a samsung galaxy s6 and i when through the set up and it is not giving me the option to set EE wifi calling up? anyone had this problem?

    Where did you buy the phone.
    If not direct from EE you won't be able to use the WiFi Calling service

  • Im trying to update my iphone with ios 5 but, for some reason its not giving me the option to do it? i've restored my phone once like it says do on the website and it hasnt done it? what can i do ?

    Im trying to update my iphone with ios 5 but, for some reason its not giving me the option to do it? i've restored my phone once like it says do on the website and it hasnt done it? what can i do ?

    Are you sure you have a 3GS and not a 3G?  The 3G cannot be updated to iOS5.  What version are you on now?... Settings > General > About > Version

  • I am trying to sync my camera roll photos and videos to itunes, but it is not giving me the selection to do so. what do I do?

    I am trying to sync my camera roll photos and videos to itunes, but it is not giving me the selection to do so. What do I do?

    You import them as you would with any digital camera.
    Pics taken with iphone are not part of the sync process at all.
    iOS: Importing personal photos and videos from iOS devices to your computer
    iPhone User Guide (For iOS 5.1 Software)

  • Trying to renew my subscription and can't seem to figure this out, my plan doesn't need renewed until feb 2015 so its not giving me the option to manage my account. Creative cloud isn't giving taking the $ off my credit card why? The $ is on my credit car

    trying to renew my subscription and can't seem to figure this out, my plan doesn't need renewed until feb 2015 so its not giving me the option to manage my account. Creative cloud isn't giving taking the $ off my credit card why? The $ is on my credit card. Thank you.

    Log out of your Cloud account... Restart your computer... Log in to your Cloud account
    or
    Verify Account https://forums.adobe.com/thread/1465499 may help
    -Credit card https://helpx.adobe.com/utilities/credit-card.html

  • HT4236 Why will my iPod not sync all the photos I want it to - I get a message saying that it cant display certain images.  All my photos are in jpg format and similar size.

    Why will my iPod touch not sync all the photos I want it to.  I get a message saying it cant display some of my photos.  They are all in jpg. format and similar size. Never had any problems before!
    Thanks

    That sounds exactly like an issue that has plagued McAfee users for around a year.
    Try disabling email scanning in your anti virus program.

Maybe you are looking for

  • Custom report to work in different languages EN and ZH.

    Hi, I wrote the report which has to work on languages EN and ZH(chinese language). It is working fine in EN, When I login with language 'ZH', the selecion screen is not displaying in Chinese language. Is there anything to do to display the selection

  • Looking for a good method or APP to have client sign a form in a text box

    I am looking for a good method or App to take an existing form/Document and have a client sign, date etc.  I will want to create the text boxes in a stationary location.  Possibly to also take a picture to add to form. Has anyone used any apps to acc

  • Exception Message 20

    Dear Friends     For one Raw material there is two reservations are there. For these two reservations ( qty each: 1) 3 purchase orders availble.One purchase order have exceptin message 10, second have 15, third have 20 ( means cancel the process). Th

  • Org.units structure/hierarchy

    Hi all, I need org.units hierarchy/structure. I think of a table with fields like org.unit id, parent org.unit id. The data should be suitable for building a tree later which will display the org.units hierarchy. I read much in the forum, but I didn'

  • Drawing object on the intersections point of 2 lines.

    hi guys, im very new in actionscrip , please give me some guidance. i'm doing this project , about 2 lines intersecting each other(the 2 lines are not always on the same position) . i try to find the intersections point using collision detection meth