Between clause is not working for me

my query does not give me the right output. when I use 1-12-2008 for min value and 11-12-2008 for max value. I was supposed to get result only for year 2008 but i am getting the result that includes year 2000,2001.....any idea why i am not getting the right result?
thanks
SELECT   v.vendor "Vendor Id", r.addrnum, v.vnamel "Vendor Name", r.aaddr1,
         r.acity, r.vasst1, r.astate state, r.azipcode,
         TO_CHAR (MAX (p.datepur), 'MM/DD/YYYY') "Last Plan Purchased Date",
         TO_CHAR (MAX (p.datepur), 'YYYY/MM/DD') "Plan Purchased Date",
         TRIM (r.aaddr1 || DECODE (TRIM (r.aaddr2), NULL, '', ' - ')
               || r.aaddr2
              ) address,
         SUBSTR (DECODE (TRIM (r.vasst1),
                         NULL, 'N/A',
                         '000/000-0000?', 'N/A',
                         '000/000-0000', 'N/A',
                         r.vasst1
                 1,
                 12
                ) fax,
         SUBSTR (DECODE (TRIM (r.aphone),
                         NULL, 'N/A',
                         '000/000-0000?', 'N/A',
                         r.aphone
                 1,
                 12
                ) phone
    FROM vendor v, vendaddr r, planhold p
   WHERE v.vendor = r.vendor
     AND p.vendor = r.vendor
   --  AND (p.datepur >= TO_DATE ('01-01-2000', 'MM-DD-YYYY'))
     AND p.datepur IN (SELECT MAX (p.datepur)
                         FROM planhold p
                        WHERE p.vendor = r.vendor)
     AND v.vobsolet = 'N'
     AND v.vnamel LIKE '%'
     AND r.astate LIKE '%'
--minvalue and max value test
     AND (TO_CHAR (p.datepur, 'MM-DD-YYYY') BETWEEN '&MINVALUE' AND '&MAXVALUE')
GROUP BY v.vendor,
         r.addrnum,
         v.vnamel,
         r.aaddr1,
         r.aaddr2,
         r.acity,
         r.astate,
         r.azipcode,
         r.aphone,
         r.vasst1,
         p.datepur

You are comparing dates as strings. You need to compare dates as dates.
AND (TO_CHAR (p.datepur, 'MM-DD-YYYY') BETWEEN '&MINVALUE' AND '&MAXVALUE')
Should be:
AND (p.datepur BETWEEN to_date('&MINVALUE', 'MM-DD-YYYY') AND to_date('&MAXVALUE', 'MM-DD-YYYY'))
If you compare them as strings, then:
'10-20-2001'
is between '10-10-2008' and '10-30-2009', alphabetically.

Similar Messages

  • Linking between pages is not working for me on mobile devices. Can someone help?

    I can get the page linking to work on my desktop machine, but when I preview on mobile devices through Edge Inspect the page does not work. It tells me the page can't be found. Can someone help? - Thanks Robin

    Try downloading Reflow Preview 8 that was released yesterday and see if that fixes it. If not can you post the name of the page you are trying to link too and I'll see if I can reproduce it.
    Thanks for you help and thanks for using Reflow,
    Chris

  • Multiple account assignment switching between distribution indicators not working for service

    Hi Gurus,
    Account assignment distribution function not working post ECC6 patching activity
    we have recently completed ECC6 patching actvity and we are facing issues on processing multiple account assignment in service.
    we create Purhcase order with single account assignment and will process service with Multiple account assignment selecting distribution on qty or percentage basis till patching functionality works fine post patching we are facing issue when we are selecting distribution indicator system provides an error message switching between distribution indicator is not allowed when we continue system ask to enter in case of multiple account assignment select the distribution indicator. could you please suggest me on the issue.
    Thanks in advance.

    we have found a SAP note
    1915000 - SE685 - Switching between distribution indicators is not allowed
    This is now standard behavior.

  • SNAPSHOT : clause IN not working for more than 1 entry

    Greetings,
    I'm trying to use snapshots templates to confine a snapshot to a
    particular set of data. My 'where' clause of my snapshot is
    something like this:
    (...) where attribute IN (:VALUES)
    -When I define my template variable VALUES as "'value1'", it
    returns ok only the records which attribute has the
    value 'value1'. [OK]
    -When I define my template variable VALUES
    as "'value1','value2'", it doesn't return any record!! [WRONG!]
    Is this a bug (or a not implemented feature) of oracle lite? Or
    am I doing anything wrong?
    If it is a bug, anyone has an idea of how can I turn around this
    problem if I don't know what are the filter values that I'm
    going to use (defined by each user) and how many they are?
    thanks,
    psalazar.

    In our application we tend to use views to return appropriate values for a particular user.
    For example (we do building inspections) the publication item sql is like
    select * from inspection_sites where id in (select site_id from v_pda_bi_sites where bi_id=:bi_id)
    The view acts like a dynamic parameter table (in this cases looks at experience level, status of sites, and responsibility allocations). Once the driving views are tuned this works quite efficiently, and as the dependant tables for the publication item automatically includes all of the tables in the driving view, the object gets refreshed if there is any change to any of them, even if the site details themselves have not changed

  • Software Update Point Switching is not working for some Clients

    Hi there,
    I found nothing similar here and I hope this is the right section.
    I´m running ConfigMgr 2012 R2 where one of the Site Systems from one of the Primaries is located in an untrusted Forest in a perimeter Network. The Site System there has the MP, SUP and DB Roles. In general it works great. The Systems in that untrusted Forest
    get the SCCM Agent pushed, see and can install published Software packages and receive Windows Updates. But there are a few systems where everything works, except Windows Updates.
    So I had a deeper look at what is happening and found out that the SUP switching is not working for them. They always try to contact the SUP from the Primary, which they cannot reach (this is intended).
    From how I understand SUP switching as described here
    http://blogs.technet.com/b/configmgrteam/archive/2013/03/27/software-update-points-in-cm2012sp1.aspx#pi140062=1
    the Windows Update Agent tries to connect to a SUP every 30 minutes and after 4 failed attempts he will try to connect to the next one until he finds one which works.
    As I said before, this seems to work for most systems in the untrusted forest, but some do not make any intentions to switch the SUP.
    So my next step was to find out from where the Update Agent can get the information of the available SUPs. I think they either don´t receive the information that other SUPs exist, or if the Information is there, they don´t realize that there´s an error and
    make no attempt to switch.
    I used the System Center Support Center to gather all Information from some of the systems with that problems (Log Files, WMI information, registry information, policies etc.) but I cannot find where SCCM or the Update Agent store the information which SUPs
    are available in my environment.
    I´m sure the problem is on the Systems which fail to connect to the right SUP and not in the SCCM infrastructure itself, because for most of the systems everything is working just perfect. Unfortunately in the Blog Post above there´s also no information
    where this information is stored and how it is obtained by the clients. In the comments there´s even one post which describes the same problem I have here, but there was no answer. I hope someone can point me into the right direction, because I´m stuck currently.
    Things I tried additionally to all the log file / WMI / registry sniffing:
    Removing the Software Distribution Folder and restarting the Windows Update Agent
    Removing the WindowsUpdate Registry folder in the HKLM\SOFTWARE\Policies\Windows section in the Registry and restarting the Windows Update Agent.
    Tried to reset the WUAgent with wuauclt /Resetauthorization additionally to the steps above.
    I also tried to manually set the WUServer and WUStatusServer Keys in the registry to the new Server, but as soon as the next Update Scan cycle runs, the value is set back to the URL of the Primary Sites SUP
    Is someone having additional ideas? It seems to me older systems are more affected (which were configured for a standard WSUS before SCCM 2012 was deployed) than newer ones which were installed when SCCM was in place already. But I don´t know what else to
    "reset" on those machines without reinstalling them.

    Thank you very much for your response. I must have missed that one by looking through numerous Logfiles. In this, there´s indeed a list of all available SUPs. So according to the LocationServices.log the machine should have a choice.
    The WMI Key however, contains just one entry and this is the URL of the Primaries SUP which is not reachable in the untrusted forest. Is it OK that the WMI entry includes only one entry? If yes, what process is putting the results from the LocationServices
    into WMI? It seems like the Windows Update Agent is feeded from the WMI Key then. If this is the case my problems seems to be the "communication path" between these two components.
    Is this the job from the SCCM Agent, the Windows Update Agent or maybe some third component I´m not aware of? I wonder how I can fix this.

  • In Report,order by clause is not working

    Hi All,
    For the report i prepared the query in this one am using the order by clause,i run the query in the sql plus working fine am getting the data based on the order by clause.when i use the same query for the report am getting the data but not in the order(i.e order by clause in not working).
    Please help me how to do this one.
    Thanks in Advance.
    Regards,
    Leelakrishna.G

    Hi Dora,
    Data is coming in the proper sequence,but in the first group data is not coming(In first group data first line only displaying,remaining data is not comming).
    My req is:
    The report is executing based on the creation date(i.e.,from creation date to today).
    In this so many Purchase requisitions will be there for this one different approval in different times will be there.
    For Ex:
    we will take 2 PR number only(for the first one 3 approvals,second one 4 levels of approval).
    1. one supplier 1person raised by 1PR submit
    No Action
    Approve
    2. 2Supplier 2personraised by 2PR Submit
    NO Action
    Forword
    Approve
    with ur suggestion am trying data is gettin fine but first group first line is coming remaining data is not coing.
    EX:
    1. one supplier 1person raised by 1PR submit
    No Action
    Approve
    2PR Submit
    NO Action
    Forword
    Approve
    Note:"2. 2Supplier 2personraised by " this kind of lines data is missing.
    Can you pls check and suggest me how i can do this.
    Thanks in Advance.
    Regards,
    Leelakrishna.G

  • SSO is not working for SAPGUI for HTML

    Hi Experts,
    We have configured SSO between EP and ECC.SSO is working fine for SAPGUI for windows.But it is not working for SAPGUI for HTML.
    Workflow iViews are getting error.
    "SWITCH to HTTPS does not occur."
    The domain names are different for EP and ECC.
    Please let me know ,is there any settings need to check.
    Regards,
    Bala.

    Hi
    The point here is that your Portal server is on a different domain, so you have to configure the logon ticket issuer (portal) to generate logon ticket for multiple domains.
    http://help.sap.com/saphelp_nw04s/helpdata/en/a0/88a340fa432b54e10000000a1550b0/frameset.htm
    Best regards
    Johann

  • Incoming Email not working for one web app, but IS working for others in same farm.

    I have enabled incoming email in a large multi-web application farm running SharePoint 2013 SP1 and the Feb 2015/March 2015 CUs that were pushed down in Windows Updates.  It works just fine for two web applications, but it will not work for one particular
    web application. I see the email land in the /drop folder. If I remove the email address from the library in http://nonworkingapp web
    application and use it on a library in a http://working web application, then the email is processed successfully. Conversely,
    if I take an address from a library in http://working and move it to a library inhttp://nonworkingapp it
    does not work. I've tried multiple site collections on http://nonworkingapp. This rules out any SMTP issues, etc. and means
    the issue is bound to this web application. Permissions are the same between the "non-working" and "working" locations: domain users are members on the site, and the library inherits permissions from the site.  The App Pool and Timer
    Service accounts have rights to the folder and to the library.
    The error in the ULS log is the typical error processing message, but it gives no additional information even though I have enabled Verbose logging.
    The Incoming E-Mail service has completed a batch. The elapsed time was 00:00: 00.0156294. The service processed 2 message(s) in total. Errors occurred processing 2 message(s): Message ID: Message
    ID:
    Typically, you see "alias not found" or some permissions or quota issue here, but this issue is NOT the same as those. In this case NO additional information is provided in ULS.
    Edit: running stsadm.exe -o refreshdms -url http://one/failing/site fixed some similar issues where "Unknown alias" was
    reported even though the list did have an alias (see here:http://blogs.technet.com/b/vinitt/archive/2009/07/15/e-mail-enabled-list-alias-information-is-not-synchronized-between-configuration-database-and-content-database.aspx).
    This did not fix the issue for the case mentioned above.
    What could possibly be the issue preventing incoming email from working on this one web application?

    Thanks for your reply.  Incoming E-Mail was running on all 3 WFE, however I do not think this was the cause.  As noted, _other_ emails send to http://workingapp are working just fine.  I can send two emails - one to a library on http://workingapp
    and another on http://notworkingapp.  The email to http://notworkingapp will sit in the drop folder, while the one to http://workingapp will be processed correctly.  In addition, the ULS log on WFE1 indicates an attempt to process the file fails.
     So clearly, the timer job on WFE1 is running and attempting to process the file.  For kicks, I disabled the service on WFE2 and WFE3, but with no change in the behavior.
    WRT to #1, I have done this already (as noted in the original post).  I can remove an alias from http://workingapp and place it on http://nonworkingapp and it is not processed.  If I return it to http://workingapp it is processed.  In other
    words, I go into Library Settings -> Incoming Email for a working library, and copy the alias, then disable incoming email for that library.  I then go to Library Settings -> Incoming Email for a non-working library, enable incoming email, and paste
    the alias.  Once done, emails sent to the alias are not processed.  I then do the reverse, and it works again.
    On #2, I have already tried multiple libraries on http://nonworkingapp (also as noted in the original post).
    In my environment, incoming email does not work for any library on http://nonworkingapp, but does work for any library on http://workingapp.  Troubleshooting listed above has ruled out any problem with basic mail server configuration or library settings
    - the problem is bound to http://nonworkingapp
    I'm not sure what you mean by "steps to reproduce the issue".  If I knew that, I would probably be able to solve the issue.  The best I could come up with to describe the situation would be:
    Set up SP 2010 in a three-node configuration with multiple web apps
    Enable incoming email and confirm it works
    Migrate to a SP2013 SP1 farm in a three node configuration.
    Enable a new email alias for a library
    Observe that it doesn't work for one web application.
    Obviously, it's pretty unlikely that attempting that in a lab would actually have the same result.

  • Speakers not working for Skype only on Windows 8.1

    My speakers or headphones are not working for Skype desktop but work fine for any music or videos or other programms. Any help to resolve it? in Tools>Options>Audio Settings> headphones does not show up. Everything was working fine but it just happend a day before., i havent installed any program that could make problem.

    This is very strange because, as you are saying this happened without any change to any software on your computer. I suggest the following:
    1. To help the team analyze the issue, provide logs as described in this link  under Skype for Windows Desktop and attach it to your post.
    2. As an interim solution you can try using a virtual audio device that will be a middle man between skype and your physical audio device.

  • Does br Not work for Safari Browser?

    Using Safari on Vista
    If you look here http://www.banquettables.pro/ When you add an item to the cart, there is a shopping cart that appears using ajax in the right column.
    THIS Text Below shows up.
    You may checkout online securely, or call and order 866-290-0813
    We Accept Visa, MC, Discover, and AMEX.
    BUT the thing is , there is a
    between the 2 sentences to make a space. This works in all browsers but safari.
    Does
    NOT work for safari?

    A BR tag just makes a line break, not an extra space between lines. It seems to be working fine in Safari. Perhaps a paragraph break <p /> i s what you want.

  • "Track Shipment" is iOS4 does not work for Canada Post tracking numbers

    Not 100% sure this is the best forum to post this but couldn't find an iOS specific forum.
    When an email arrives with a shipment tracking number embedded in it, iOS4 is smart enough to recognize it and turn it into a link. You click the link, select "Track Shipment" and in theory you get sent off to the appropriate shipment tracking website.
    Problem is that this does not work for Canada Post tracking numbers, I get sent to the USPS tracking site instead of the Canada Post one. I assume that the number format is similar but there must be a way to distinguish between CPC tracking numbers and USPS tracking numbers (by range ?).

    This has since become working in 4.0 and higher.
    I noticed I now get a notes folder for each of my email accounts (ie. in my case; MobileMe gets one, Gmail gets another, and Virgin Media a yet another). And all three since accordingly correctly between Notes mailbox on iPhone 4 and it's counterpart Notes mailbox in the mac mail app under Reminders section.
    Additionally, just like other main mailboxes (inbox, drafts, sent, trash, junk), they also have a "unified" box at the top in both mac and iphone, in order to view notes in all email accounts at the same time.
    Hooray Apple, shame it took so long, but at least it's here now

  • I have an event in my calendar that was sent by someone who does not work for the company anymore and I am reminded 2 times a week. How can I remove it?

    I have an event in my calendar that was sent by someone that does not work for the company anymore and I am reminded 2 times a week. How do I delete it?

    Tap on the event to open the event. Click the 'Edit' button in the event bubble, then press the 'Delete Event' button at the bottom of the Edit pop-up. It's a little different for events that come through Microsoft Exchange, you tap the event to bring up bubble and click the 'Details' button, and then press 'Decline' to remove the event.

  • IPhone 6 External Mic not working for Siri/Dictation

    I am finding that the external mic on my iPhone 6 works for phone calls and voice memos, but does not work for Siri/Dictation.  When I plug in the earbuds, they work for everything (including Siri/Dictation).
    Was chatting to Apple support who had me reset all settings.  I thought that worked, but realized that after a reset, Siri is off and I was talking to "Voice control" (which works).  When I turned Siri back on, it does not work.
    I have two questions for the community to see if you can help:
    1- I have been assuming this must be a software problem since the mic does work for non-Siri access.  But is that true?  Is there a hardware component that Siri depends on which could be faulty here?
    2- If it is software, what action should I try to address it?  I have done a reset all settings already and that did not help.
    Doug

    Hi, everyone.  I talked to Apple Genius at Apple Store last week, she said it should be a software issue and I needed to reset my iphone 6 plus as a new device and I can not use the backup restore from my iCloud, it was because the microphone bug or glitch can be in the backup also. Ok, followed her advice, erased all contents and set my iphone as a new device , the microphone worked for an hour, but went bad again.  I used "voice memo" app from Apple to test the microphone. It is the best tool since it doesn't involve any provider's network and it doesn't need another person's phone to listen and test.  If you can hear your voice recording clearly, then the mic works.  I tested it 3-4 times a day for a few days now, half of the time the mic doesn't work.  So, set as a new device isn't working. The issue is intermittent and it comes and goes as it likes, so very annoying. I carry my Apple EarPods with me in these past few days ust in case I need to make important phone calls.  Will need to go back to Apple Genius this weekend for sure.  Will give update after the weekend.

  • CALLER ID not working for International incoming calls

    Hi,
    I've a strange issue where CALLER ID not working for International incoming calls, it shows INTERNATIONAL UNKNOWN NUMBER in the phone display, but the number shows correclty in Verizon Call assistant !!!
    Any clue?

    yashshankar wrote:
    Hi
    I recently  purschased an Online number but the caller id does not work for incoming calls.How do we resolve this problem?.
    Regards
    Yash
    You didn't mention what country your Online Number is in.  Not all of Skype's Online Numbers are eligible for use as Caller ID when calling telephones or sending SMS messages.  If your number is from one of these countries (Chile, Denmark, Estonia, Hong Kong, Poland, Sweden, the UK and the US), then it can be used this way.  Otherwise, you can use a mobile number from countries other than Japan or Mexico as Caller ID with Skype, after the number goes through a verification process where Skype sends SMS messages with codes to that number.
    To get to these settings, log into your Skype account here on the Skype web site using the "Account" link at the top of this page.  You'll see a screen that would include your current Caller ID settings, and a link to change that.  If your Online Number is from one of those countries I referenced above, just select it and you're done. 
    Hope that helps!
    Patrick
    Location/Ubicacion: Arizona USA
    Time Zone/Hora Local: UTC/GMT -7
    If this message has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others.
    Si esto mensaje le ha ayudado, por favor haga clic en "Aceptar como solución". Si encuentra un mensaje útil, por favor "Da Kudos" al final del mensaje, por lo que esta información puede beneficiar a otros.
    I am not a Skype employee. No soy un empleado de Skype.

  • Select All in a table does not work for Drag and Drop

    Hi. I am using Jdeveloper 11.1.1.2 but have also reproduced in 11.1.1.3.
    I am trying to implement drag and drop rows from one table to another. Everything works fine except when I do a Select All (ctrl-A) in a table, the table visually looks like all rows are selected, but when I try to click on one of the selected rows to drag to the other table, only the row I click on is dragged.
    I tried setting Range Size -1, fetch mode to FETCH_ALL, content delivery to "immediate" but nothing works.
    I even have reproduced not using a view object but just a List of beans with only 5 or 10 beans showing in the table.
    Does anyone know how to get Select All to work for a Drag Source?
    Thanks.
    -Ed

    Frank-
    OK, thanks for looking into that. I also submitted this service request, which includes a simple sample app to demonstrate the problem:
    SR #3-2387481211: ADF Drag and Drop does not work for rows in table using Select All
    Thanks again for the reply.
    -Ed

Maybe you are looking for