Search results for MySQL & gt; 2 days ago

Hi all

I'm doing a site for a group and would like to have a section of the site that shows how their performance will be. I want this to show all events and all the events that have taken place over the last 2 days.

Right now I have my mysql updated query in place with ' WHERE Shows.show_date > = NOW() ' and that works well, but is there a way to also pull the data for 2 days before NOW() events?

I use mysql and php.

Thanks in advance for any help/suggestions you may have!

.oO (sfopp)

> I'm doing a site for a group and would like to have a section of the site
> which shows when will be their performance. I would like to show everyone to come
> events and all the events that have taken place over the last 2 days.
>
> Right now I have my mysql updated query in place with ' WHERE Shows.show_date > = NOW() '.
> and that works well, but is there a way to also pull data for the 2 events
> days before now()?

Sure. Take a look at DATE_SUB () / DATE_ADD ():

http://dev.MySQL.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-add

Micha

Tags: Dreamweaver

Similar Questions

  • I registered for free trail 1 day ago and is gone in to use it today and it says expired

    I registered for free trail 1 day ago and is gone in to use it today and it says expired

    If the trial version shows as expired, then it expired. There is no way to prolong the trial.

    You will find more details on the Adobe trial software has expired at the beginning -http://helpx.adobe.com/x-productkb/global/trial-software-expired-early .html.

  • I want to erase the search results for certain searches. When I search for some keywords I get old SERPs that I know are not up-to-date. If I use a different machine, I get the current results. I can't find how to clear it.

    I am tracking my own Web site position in search rankings. For a short period, he appeared on page 1 for certain keywords. It is now on page 2 or 3, (as seen by me and other users when you use another computer or a browser), but when I search on my computer I see the old pages of results showing the top of page 1. How can I erase these old pages of results?

    If you press Ctrl and F5 at the same time, that changes? I think that Google (I guess that's what you're referring to the) changes in search results is inspired by a little if you are connected and preferences, etc.. Try to connect on google if you are connected.

  • search results for Firefox does not open. I rebooted and prob persists.

    Firefox's search results will not be not open if clicked.

    I removed and reloaded firewfox and the problem remains.

    My Favorites and bookmarks open wind, but new research results will not open if clicked.

    the image and video features open if clicked on, but none of the sites listed in the search results will open.

    -> Tap ALT key or press F10 to display the Menu bar

    -> go to Menu help-> select restart with disabled modules

    Firefox closes, then it will open with Firefox comes from base. Now follow these steps:

    -> Update ALL your plugins Firefox https://www.mozilla.com/en-US/plugincheck/

    -> go to Menu view-> toolbars-> all unwanted/incompatible deselection with toolbars

    -> go to the Menu Tools-> clear recent history-> range of time: select 'ALL' -> click details (small arrow)-> location-> checkmarks on the Cookies, Cache , click clear now

    -> go to the Tools Menu-> Options-> content-> place the check on:

    Images of care 1) block popups 2) automatically) 3 turn on JavaScript

    -> go to the Tools Menu-> Options-> Security-> place the check on:

    ((1) Warn me when sites try to install modules) 2 block reported attack sites block 3) declared false web 4) remember passwords for sites

    -> go to the Tools Menu-> Options-> advanced-> network-> Offline Storage (Cache): click on the clear now button

    -> Click OK in the Options window

    -> click on the favorite on the search bar icon-> click Manage search engines -> select all unwanted search engines and click delete -> click OK

    -> go to the Tools Menu-> Modules-> Extensions-> section REMOVE all unwanted/Suspicious/Incompatible (modules)-> restart Firefox Extensions

    -> go to the Tools Menu-> Modules-> appearance-> section REMOVE all unwanted/Suspicious/Incompatible (Persona)-> restart Firefox

    You can activate your known & modules worthy of trust and themes later. Check and tell if its working.

  • "black square shrinking" appears when some the search results for "Array Constant" are double-cliquée.

    In the process of troubleshooting an issue of size of table, I did a Ctrl + F search after selecting a constant matrix.  I find a large number of raster constants in the search results.  However, many of these results (most behaves normally), if the item in the search results has double-clicked, momentary displays a black square, about the size of a standard icon, which immediately reduced to nothing.  There is no indicator selection outline.  I used this nice ShowAllControls & TabCtrl .vi utility to display all the controls, but nothing appears in this place.

    Someone has encountered this?  So far, it's just a nuisance. I am not free to view the code that was developed by a third party.  I would like to make a screenshot, but the black square disappears too quickly.


  • 0 search results for modules

    When you use the search box on https://addons.mozilla.org/en-US/firefox/ it shows suggestions as I type. But when I hit enter or click on search I get 0 results.

    There is a bug reported for this question (don't post in the bug, report as provided for Mozilla developer discussions and resolutions only)-> https://bugzilla.mozilla.org/show_bug.cgi?id=767683

    The short term solution is the following:

    • your search from the search Add page - on, then press the Enter key
    • on the results page (showing no found items), in the margin on the left under "Works with", select "All systems", and the results page will fill based on your entry in the search box
    • Unfortunately, the results will be for all operating systems and all versions of Firefox,

    The only other options:

    • Enter both in the area of research to Add on as possible and choose in the menu under the search field
    • Use a search engine (like Google) to search for modules in their name and look for a link with https://addons.mozilla.org/... start

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • How can I remove malware that redirects to another site search results for example find fast answers?

    Whenever I use the search engines Google or Bing for a topic and receive the results, whenever I try to click on the link in the results, my research turned away on gimme responses or answers or some other search engine site instead of take me to the link I have on that clash.

    How can I remove it?

    I use Microsoft Security Essentials.

    Hi Steve_661,

    Please try to do a scan with the Microsoft Safety Scanner:

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    I hope this helps!

  • change/stylize the re ' search results for use on screen .htmlText

    Hello

    I am working on a search function but have a little trouble finishing some details display. The following code works very well to find and display the text in an xml file, but I want the results displayed differently.

    Use the following as a source XML, I would like to:
    -Put highlighted in red (var searchTerm) search term when found in the xml file
    -Add a few characters before and after the search term to give the term found little context

    For now, how could I add 3 characters before and after the search term, as follows: "The first tex" - and highlight 'first' in red?

    Thanks much for any help.
    ~ chipleh

    var xmlFileToSearch:XML = 
    <xml>
         <sim>    
              <bodyText>
                   <page number="0">        
                        <para><![CDATA[The first text to search]]></para>
                   </page>
                   <page number="1">
                        <para><![CDATA[The 2nd text to search]]></para>
                   </page>
                   <page number="2">
                        <para><![CDATA[The 3rd text to search]]></para>
                   </page>
                   <page number="3">
                        <para><![CDATA[The 4th text to search]]></para>
                   </page>
              </bodyText>
         </sim>
    </xml>
    ;
    
    function searchXMLFile():void
    {            
         var xmlBody:XML = xmlFileToSearch.sim.bodyText[0];
         var pageList:XMLList = xmlBody.page; 
         //String to search for
         var searchTerm:String = "first";  
         for (var i:int = 0; i < pageList.length(); i++)
         {  
              var item:XML = pageList[i];
              var textList:XMLList = item.para.text();    
              for (var j:int = 0; j < textList.length(); j++)
             {   
                   var t:XML = textList[j];   
                   //if the string is found
                   if (t.toString().toLowerCase().indexOf(searchTerm.toLowerCase()) != -1)
                   {      
                        //traces "Page 1. - The first text to search"
                        trace("Page " + (Number(item.attributes())+1) +". - "+t.toString());
                        //How could I add 3 characters before and after the search term, like so: "The first tex" 
                        //- and highlight 'first' in red?   
                        searchDisplay.htmlText += ("Page " + (Number(item.attributes())+1) +". - "+t.toString());            
                   }   
              } 
         }
    }
    
    searchXMLFile();
    


    t.substring(t.indexOf(searchTerm) - 4, t.indexOf(searchTerm)) + "" + searchTerm + "" + t.substr(t.indexOf(searchTerm) + searchTerm.length, 4);
    
  • PSE8 Organizer - search results for Odd keyword tag

    Question for example of marking in the Organizer 8 elements.

    I have 2 friends Bill and Sandra (keyword tags), they belong to the same sub-group "Friends."

    Now, when I'm looking for PSE8 Organizer Sandra e.g. by check the checkbox for 'Sandra '. Photos much more only Sandra appear the result set. For me this make no sense at all.  BUT on the other hand, if I create a subcategory of "Sandra" and tag the pictuters even with that, then I have no problem. Only pictures of Sandra (as a subcategory) tagged will be present in the result set.

    Thank you very much for any clue or help.

    Nemo

    Since your labeled image "Sandra" is part of a battery, when you search for 'Sandra', PSE 8 shows the full stack. For these photos, where 'Sandra' is not labeled, PSE 8 shows red icon at the top left of the image to indicate no match.  This is also true for games version as well.

    Had your images is not part of the stack, PSE 8 would have shown you only photos marked "Sandra."

    Please let me know if you have any doubts.

    ~ Sourabh

  • Can't see how to set the search results for UK only

    When searching in Firefox, I used to be able to click on 'Search tools' and find only options for 'any country' or 'UK '. This is more so I'll have to trawl through a lot of unnecessary stuff when I want something local. Can I get that back

    I think that Google has stopped redirect EN - GB users automatically from .com to. co.uk for a reason any. When you're on .com, you really don't get country-specific options.

    What I suggest is to install a plugin of U.K. research directed to the next page and make that your default value:

    http://mycroftproject.com/Google-search-plugins.html

    One titled "Google UK - the UK (SSL)" sounds like the best match for you.

    Does it work?

  • After the search results for updating data

    Hi all

    We have requirment.

    We have from the data of the OTL requirment.

    We're getting data destruction part otl after we have updated the table in Oracle Application.

    based on the table of the custom, we created the search page. Search page up works very well. I created the Manula research with advanced table.

    When enter the number of employee and data to date. get the Resusts Table. with MessageTextInput

    Here, we get the problem

    We want to put the ResulsTable values.

    As
    Search page enter the input values: number: 1001

    Array of result values.

    Employee employee number name Nohours Extra hours Date
    1001, VENKAT REDDY 8 3 28 AUGUST 2009


    We want to change the values above except the name of the employee, the employee number.

    Can you give me any suggestions how to reach my requirment. If possible take the high monitoring...


    Thank you
    Venkat Reddy Pulichintha
    [email protected]

    Hi out,.

    There may be several ways of doing things... I mentioned a...

    You mentioned the other is...

    The two will suffice.

    Thank you
    Gerard

  • I played with my xbox 360 on my LCD 32 inch tv for Christmas about 3 days ago, I went to turn it on everything, and it is has a blue screen I tried the same thing I think but no luck can help you pls.

    the xbox360 is going through the port at the back of the tv ypbpr and I tried to change from tv to hdtv on the back of the head of the xbox, but still won't help.

    Hello

    As you said that you have connected the Xbox 360 on your TV, I suggest you to ask your question in the Xbox forums, because they will be in a better position to help you.

    http://www.Xbox.com/en-us/community/

    For your information, I provide you this link.

    The screen of your TV or monitor is empty when you are connected to your Xbox 360 console

    http://support.Xbox.com/support/en/us/NXE/KB.aspx?ID=916158&lcid=1033&category=hardware

    Hope the helps of information.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Search results for problem when I change the OS hardware

    Dear Sir

    Whene ever I change hardware like RAM access usb it ask the Windows Activation on a virtual machine, I use Windows XP

    You must not modify virtual hardware too often - MS allows only a limited number of changes until they suspect abuse.
    Better choose a reasonable amount of vRAM and stay that way.
    Also do not remove and readd the USB controller.

    It's expected behaviour unless you have a volume license.

  • CPU utilization for past 7 dayes ago

    Hi, I want to get the value of oracle database for the use of the processor for the last 7 days ago.
    Best regards/allahmorad

    Hello

    You can try to check from

    OEM > hosts > Performance > view choose CPU details (left side) > right to view the data, you can choose period

    Or better way donwload OSwatcher and you can get a report from there:
    OS Watcher [ID 301137.1] user guide
    Graphics HOWTO of the data captured by OS Watcher for Windows (OSWFW) [978452.1 ID]
    How to start OSWatcher every time you start the system [ID 580513.1]

    Respect of
    HELIOS

  • How to set the flag for the first 3 days

    Hi all

    I have a table with a complete list of April and may 2015 date month and his working days (just for example, I have included only in April and may 2015 data but the table has data for 20 years since 2000).

    Below is the table create and insert scripts for complete data.

    CREATE TABLE dates_dim(day DATE, business_day NUMBER, month NUMBER, day_of_week VARCHAR2 (100));
    
    Insert into DATES_DIM Values (TO_DATE('05/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, '201505', 'FRIDAY');
    Insert into DATES_DIM Values (TO_DATE('05/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SATURDAY');
    Insert into DATES_DIM Values (TO_DATE('05/03/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SUNDAY');
    Insert into DATES_DIM Values (TO_DATE('05/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2, '201505', 'MONDAY');
    Insert into DATES_DIM Values (TO_DATE('05/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 3, '201505', 'TUESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/06/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 4, '201505', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 5, '201505', 'THURSDAY');
    Insert into DATES_DIM Values (TO_DATE('05/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 6, '201505', 'FRIDAY');
    Insert into DATES_DIM Values (TO_DATE('05/09/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SATURDAY');
    Insert into DATES_DIM Values (TO_DATE('05/10/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SUNDAY');
    Insert into DATES_DIM Values (TO_DATE('05/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 7, '201505', 'MONDAY');
    Insert into DATES_DIM Values (TO_DATE('05/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 8, '201505', 'TUESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/13/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 9, '201505', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/14/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 10, '201505', 'THURSDAY');
    Insert into DATES_DIM Values (TO_DATE('05/15/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 11, '201505', 'FRIDAY');
    Insert into DATES_DIM Values (TO_DATE('05/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SATURDAY');
    Insert into DATES_DIM Values (TO_DATE('05/17/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SUNDAY');
    Insert into DATES_DIM Values (TO_DATE('05/18/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 12, '201505', 'MONDAY');
    Insert into DATES_DIM Values (TO_DATE('05/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 13, '201505', 'TUESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/20/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 14, '201505', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 15, '201505', 'THURSDAY');
    Insert into DATES_DIM Values (TO_DATE('05/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 16, '201505', 'FRIDAY');
    Insert into DATES_DIM Values (TO_DATE('05/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SATURDAY');
    Insert into DATES_DIM Values (TO_DATE('05/24/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SUNDAY');
    Insert into DATES_DIM Values (TO_DATE('05/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'MONDAY');
    Insert into DATES_DIM Values (TO_DATE('05/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 17, '201505', 'TUESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 18, '201505', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('05/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 19, '201505', 'THURSDAY');
    Insert into DATES_DIM Values (TO_DATE('05/29/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 20, '201505', 'FRIDAY');
    Insert into DATES_DIM Values (TO_DATE('05/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SATURDAY');
    Insert into DATES_DIM Values (TO_DATE('05/31/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201505', 'SUNDAY');
    Insert into DATES_DIM Values (TO_DATE('04/01/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1, '201504', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('04/02/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2, '201504', 'THURSDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/03/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 3, '201504', 'FRIDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/04/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SATURDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/05/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SUNDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/06/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 4, '201504', 'MONDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/07/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 5, '201504', 'TUESDAY  ');
    Insert into DATES_DIM Values (TO_DATE('04/08/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 6, '201504', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('04/09/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 7, '201504', 'THURSDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/10/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 8, '201504', 'FRIDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/11/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SATURDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/12/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SUNDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/13/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 9, '201504', 'MONDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/14/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 10, '201504', 'TUESDAY  ');
    Insert into DATES_DIM Values (TO_DATE('04/15/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 11, '201504', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('04/16/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 12, '201504', 'THURSDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/17/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 13, '201504', 'FRIDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/18/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SATURDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/19/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SUNDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/20/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 14, '201504', 'MONDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/21/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 15, '201504', 'TUESDAY  ');
    Insert into DATES_DIM Values (TO_DATE('04/22/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 16, '201504', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('04/23/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 17, '201504', 'THURSDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/24/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 18, '201504', 'FRIDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/25/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SATURDAY ');
    Insert into DATES_DIM Values (TO_DATE('04/26/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, '201504', 'SUNDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/27/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 19, '201504', 'MONDAY   ');
    Insert into DATES_DIM Values (TO_DATE('04/28/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 20, '201504', 'TUESDAY  ');
    Insert into DATES_DIM Values (TO_DATE('04/29/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 21, '201504', 'WEDNESDAY');
    Insert into DATES_DIM Values (TO_DATE('04/30/2015 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 22, '201504', 'THURSDAY ');
    COMMIT;
    

    I'm looking for a select statement that defines the indicator 'Y' for April records months and "n" for records in may for the first 3 days of the request. Here's the difficult thing, the results should vary depending when they run the select query.

    For example:

    Scenario-1: If I run the SQL code may 1st, 2nd, 3rd, 4th, or 5th (with in the first 3 days), FLAG must be set on 'Y' for records in April and "n" for records in May.

    Scenario 2: If I run anywhere between May6th 31, FLAG must be set to ' do for April month and 'Y' for records in May.

    Search results for scenario 1 should look something like this the results of the SQL query below (as I can't keep the complete set of results, I wrote a select query which will give you the expected results if you run the DDL and DML scripts above)

    select day,case when day between '01-APR-2015' and '30-APR-2015' then 'Y' else 'N' end flag from dates_dim;
    

    Results for the scenario-2 should look something like this the results of the SQL query below (as I can't keep the complete set of results, I wrote a select query which will give you the expected results if you run the DDL and DML scripts above)

    select day,case when day between '01-APR-2015' and '30-APR-2015' then 'N' else 'Y' end flag from dates_dim;
    

    Please let me know if it is confusing. Thank you.

    Hello

    Thanks for posting the CREATE TABLE and INSERT statements; It's very helpfu.

    Month article it should really be a DATE, not a NUMBER. This issue (and many others) would be simpler and more effective it was a DATE, rather than a NUMBER, since it must be compared with the DATEs.

    As the month is a NUMBER, do not insert VARCHAR2 values, such as '201505', in it.

    Why is-day_of_week 100 characters?  The longest name in English ("WEDNESDAY") is 9 characters.  Day_name fairer apply in trouble.

    Here's a way to do what you asked:

    DEFINE SYSDATE = "DATE" "2015-05-05.

    DEFINE SYSDATE = "DATE" "2015-05-06.

    WITH got_effective_month AS

    (

    SELECT TO_NUMBER (TO_CHAR (ADD_MONTHS (& SYSDATE

    CASE

    WHEN COUNT (*)<=>

    THEN-1

    0 OTHERWISE

    END

    )

    , "YYYYMM.

    )

    ) AS effective_month

    OF dates_dim

    Day WHERE BETWEEN TRUNC (& SYSDATE, 'MONTH')

    AND & SYSDATE

    AND business_day > 0

    )

    SELECT d.

    CASE

    WHEN month = e.effective_month

    THEN 'Y '.

    ANOTHER "N".

    Flag of the END as the

    OF dates_dim d

    CROSS JOIN e got_effective_month

    ORDER BY d.day

    ;

    I used the proxy & SYSDATE to test.  In Production, you will use the SYSDATE function instead.

    A calendar table, like days_dim, is really a good idea.  You may consider adding a column business_day_count cumulative, a NUMBER that increments of 1 every day business.  To find out how many days passed since any day x (for example, the 1st of this month), you would only need extract the 2 rows in the table: line x and the line today.

Maybe you are looking for

  • How to add addresses to my address book?

    I want to add in my address book email addresses, but I don't know how to do this. How can I do this?

  • I don't get the feature crossed in my ipad 3 and another feature (ios 9.3)

    Please help me as soon as possible... I don't get the 9.3 iOS feature in my iPad 3 also, I don't get multitask... and I am not too clear other features

  • iPhone 5 v 9.3

    I'm moving it from 4 to 5. I supported my 4 up to the cloud and iTunes. When I try to restore my 5 my lack support, I thought that I must have 9.3, however, when I try to update my 5 I tells me that I already have the version the recent (9.2.1). I am

  • Connecting to a network with a security key that is too short for Vista

    I am trying to connect to the network to someone else. They enter my mac on their router address and gave me the key to their safety. However, when I try to connect, I get an error message saying that the security key must be 8 characters long. It's

  • Cannot log in Admin account

    Original title: SOS... AS SOON AS POSSIBLE OK... I need help as soon as POSSIBLE. I am the administrator of my computer and I CAN'T GET in! I tried everything, but he still refuses to grant access. I was even denied the system recovery and Windows it