Get the firstday and last month lastday
HelloHow to get the first and last day of the last month?
I've used this, but it returns January 1, 2010
FirstDay:
Select TRUNC (SYSDATE, 'year') of double
LASTDAY:
Select LAST_DAY (ADD_MONTHS (SYSDATE-1)) of the double
You're close
SQL> select TRUNC(ADD_MONTHS (SYSDATE, -1),'month') fom,
2 LAST_DAY(ADD_MONTHS (SYSDATE,-1)) eom
3 from dual;
FOM EOM
--------- ---------
01-DEC-09 31-DEC-09
John
Tags: Database
Similar Questions
-
How to get the first and last record
Hai All
I have a table called T1 and there are more than 8 lakhs Archives and I have a column named Timestamp, so I need to get the first record value and time stampvalue and last record and time stamp value so that I can conclude that for example
form June 13 to 15 June data are here
Kind regards
SrikkanthMWhat is the problem with:
select min(timestamp),max(timestamp) from T1;
?
-
get the first and last day of the year
and razm.date > = to_date ("' 1.01 ' |: $VDATE |", ' dd.mm.yyyy ") AND razm.date < = to_date ('31.12.2010. ' || (": $VDATE |", ' dd.mm.yyyy ");
but I get:
ORA-01830: date format picture ends before converting all of the input string
01830 00000 - "date format picture ends before converting all of the input string.
* Cause:
* Action:
: $VDATE is entered as 2010 param. I need to get data from range 1.1.2001 to 31.12.2010
THXWhy don't you use:
to_char(razm.date,'YYYY') = :VDATE
-
Get the first and the last day of the month...
Hi friends,
I'm trying to get the first and last day of a month and wants to implement that in the following code:
SELECT COALESCE (Date_A, Date_B, Date_C)
OF the double
Here Date A and B are in Format DD MM YYYY (March 14, 2008)
and Date like MM YYYY (March 2008)
How can I get the Date_C as of March 1, 2008, OR March 31, 2008 if Date A and B are NULL?
Thank you!
Published by: user11095386 on April 23, 2009 10:45Hello
In my previous message, I thought that you were starting with strings like ' 03 12 2009"and you want to display in the form of" 12 March 2009'.» If what you have is just the opposite, then simply reverse strings format in my first message. Add a comma, if you want, in the format string.
I think that's what you want:COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY') , TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY') , TO_CHAR ( TO_DATE ( Date_C, 'fmMonth YYYY'), 'MM DD YYYY') )
Notice how, on the 3rd line, TO_DATE is called without DD in the format string:
TO_DATE ( Date_C, 'fmMonth YYYY')
When you do so, by default the day the 1st of the month, so that's all you need to do to convert the VARCHAR2 'March 2009' at the DATE of March 1, 2009.
If you would like the last day of the month, not the first, when Date_C is selected, then use LAST_DAY:
COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY') , TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY') , TO_CHAR ( LAST_DAY ( TO_DATE ( Date_C , 'fmMonth YYYY' ) ) , 'MM DD YYYY' ) )
-
I've lost the last two digits of my valid key for xp pro sp2 and notebook, how do I get the key and support? where?
Hi Jonathan,.
Please go to the Microsoft Community Forums.After the description of the question, I understand that you have lost the last 2 digits of the product key.Let me go ahead and help you with the issue.Please answer these questions, which will help us to help you best.1. How did you get the product key?2. the operating system come preinstalled on the computer?I suggest you for the link and check if that helps:How to identify, locate, and replace a product keySee also:
I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further. -
How to get the second and third weekend of every month over a period of time?
Hello
No idea how to get the second and third weekend of every month on a given period without use of CLAUSE?
Thanks in advance.
Try it below,
SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.
THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 1
WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.
THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 6
Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 1
END as second_weekendday,
BOX WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.
THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7
WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.
THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7
Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 7
END AS third_weekendday
FROM (SELECT SYSDATE startdate,
SYSDATE + 300 enddate
THE DOUBLE)
CONNECT BY LEVEL<=>=>
-
Need a query to return the first and last date for a rowset.
Hello
I have a query which can be simplified to the following data, if
Assume that it is my dataset, with THE_VALUE of
Sign (Anum) therefore,-1, 0 or 1.
* (Sorry for crushed registration. "I can't understand this website's rich text formatting.) *
THE_VALUE THE_DATE THE_MEMBER
1 0 1 January 2007
1 0 1 February 2007
1 0 1 March 2007
1. 1 April 1, 2007
1 1 1 May 2007
1 0 1 June 2007
1. 1 July 1, 2007
1. 1 August 1, 2007
1 0 01 - sep - 2007
2 0 1 January 2007
2 1 February 1, 2007
2 0 1 March 2007
2. 1 April 1, 2007
2 1 1 May 2007
2 0 1 June 2007
-2 1 1 July 2007
2. 1 August 1, 2007
2. 1 01-sep-2007
3 0 1 January 2007
3. 1 February 1, 2007
3 0 1 March 2007
3 0 1 April 2007
3. 1 May 1, 2007
3 0 1 June 2007
3. 1 July 1, 2007
3. 1 August 1, 2007
3 0 01 - sep - 2007
I need to get the lines with the THE_MEMBER, the values of the first and the last
THE_DATE, where the value is - 1, and the date range is the last
set of lines to the Member, with the same value of THE_VALUE.
I tried the following to get the dates of first and last for a set
consecutive months with the same value for the Member.
SELECT the_member
the_value
the_date
first_value (the_date)
in the first_date (PARTITION the_member, ORDER BY the_member the_value, the_date)
last_value (the_date)
during the last_date (PARTITION the_member, ORDER BY the_member the_value, the_date)
OF togola
ORDER BY the_member
the_date;
At first, it seems to work, but then, when the return value
an old value, FIRST_DATE will be the first of all the lines containing
This value for the Member rather than the first of consecutive
rows with this value for the Member. Apparently the partitioning
occurs before the order.
THE_MEMBER THE_VALUE THE_DATE FIRST DATE LAST DATE
1 0 January 1, 2007 January 1, 2007 January 1, 2007
1 0 1 February 2007 1 January 2007 1 February 2007
1 0 1 March 2007 1 January 2007 March 1, 2007
1. 1 April 1, 2007 April 1, 2007 April 1, 2007
1. 1 May 1, 2007 April 1, 2007 may 1, 2007
1-0 June 1, 2007 January 1, 2007 June 1, 2007
1. 1 July 1, 2007 April 1, 2007 July 1, 2007
1. 1 August 1, 2007 April 1, 2007 August 1, 2007
1 0 01 - sep - 2007 1 January 2007 01-Sep-2007
2 0 January 1, 2007 January 1, 2007 January 1, 2007
2 1 1 February 2007 February 1, 2007 February 1, 2007
2 0 1 March 2007 1 January 2007 March 1, 2007
2. 1 April 1, 2007 February 1, 2007 April 1, 2007
2 1 1 May 2007 February 1, 2007 may 1, 2007
2-0 June 1, 2007 January 1, 2007 June 1, 2007
-2 1 1 July 2007 February 1, 2007 July 1, 2007
2. 1 August 1, 2007 February 1, 2007 August 1, 2007
2. 1 01-sep-2007 1 February 2007 01-Sep-2007
3 0 January 1, 2007 January 1, 2007 January 1, 2007
3. 1 February 1, 2007 February 1, 2007 February 1, 2007
3 0 1 March 2007 1 January 2007 March 1, 2007
3 0 April 1, 2007 January 1, 2007 April 1, 2007
3. 1 May 1, 2007 February 1, 2007 may 1, 2007
3 0 June 1, 2007 January 1, 2007 June 1, 2007
3. 1 July 1, 2007 February 1, 2007 July 1, 2007
3. 1 August 1, 2007 February 1, 2007 August 1, 2007
3 0 01 - sep - 2007 1 January 2007 01-Sep-2007
That's what I need to get in the end.
THE_MEMBER FIRST DAY DATE OF LAST
July 2 1 2007-01 - Sep - 2007
Any ideas would be really appreciated.
Published by: user10700981 on December 17, 2008 13:57Hello
We'll call the lines whose the_value =-1 'good' lines and lines with the_value! =-1 ranks of 'bad '.
For each value of the_value, we need the first and last values of the_date where
the last row in the group is good
(b) the current line is good
(c) there is a lot of lines from the current line to the end of the Group
Condition (a) is just a special case of (c).
Conditions (b) and (c) are similar: (b) if applied to the current line, (c) applies to all lines after him. They can easily be combined into a single test that counts the number of lines after the current line or bad.Which produces the results you requested of the sample data that you provided:
WITH count_bad AS ( SELECT the_member , the_date , COUNT ( CASE WHEN the_value != -1 -- assuming the_value is never NULL THEN 1 END ) OVER ( PARTITION BY the_member ORDER BY the_date DESC ) AS bad_cnt FROM table_x ) SELECT the_member , MIN (the_date) AS first_date , MAX (the_date) AS last_date FROM count_bad WHERE bad_cnt = 0 GROUP BY the_member ORDER BY the_member;
-
My Windows Media Player only burns the 1st and last titles, nothing in between, anyone have a solution?... the titles of the first and the last burn, but the tracks between say ERROR OCCURRED, it was working perfectly last night!
original title: Windows Media Player does not burn!Hello
1. What is the exact error message you get during combustion?
2. were there any changes (hardware or software) to the computer before the show?Method 1: Run the Fixit and see if it helps.
http://support.Microsoft.com/mats/cd_dvd_drive_problemsMethod 2: perform the steps mentioned below and see if the problem persists.
http://Windows.Microsoft.com/en-us/Windows-Vista/change-settings-for-burning-a-CD-or-DVD-in-Windows-Media-PlayerClick on the link mentioned below as reference.
http://Windows.Microsoft.com/en-us/Windows-Vista/burn-a-CD-or-DVD-in-Windows-Media-Player-frequently-asked-questionsHope this information helps.
-
Need to get the report of last hour in ot txt CSV cluster
Hi all
Thanks in advance,
I work for a script where I need to get the information from vms that was revived by HA during the restart of the host.
or if we can get the report of last hour in csv or txt file cluster we can extract and find out how many virtual machines has been migirated to another host for host restarts.
Please advice.
SIV
Try the following, this will give you all the VMS who have been restarted and the time when it happened.
Connect-VIServer -Server yourserver $start = (Get-Date).AddDays(-5) Get-VIEvent -MaxSamples 1000000 -Start $start -Type warning | Where {$_.FullFormattedMessage -Match "vSphere HA restarted"} | Select ObjectName, CreatedTime, FullFormattedMessage Disconnect-VIServer -Confirm:$false
-
How do I get the toolbar and the sidebar to display in the Finder?
How do I get the toolbar and the sidebar to display in the finder window? The choices are grayed out in the view.
Hello!
You clicked on dock finder, take the cursor to the top and clicked on display and then click on hide menu bar .it toolbar is hidden.
See the side bar, tool bar again click on view - once again, click Show toolbar.
Thank you!
-
How can I get the phone and messages apps in my dock? And for some reason, I discover now all my app pages from the middle of my phone and not at the top?
Try
Settings > general > reset > reset home screen presentation.
Note: All other applications will be organised by alphabetical order.
-
Get the name and the data type into an object?
Hello
I would like to know if there is a way to get the names and the types of data encapsulated in an object of labview?
For example, let's say I make a simple object, called myObject to be commonplace, with private data: myObjectName (string), myObjectValue (int 32) (etc.)
So, how to build a method to return the type of the data of myObjectValue, or infact back the names and types of all data in the object field, which could be a lot?
Thank you
Paul.
-
I changed my google chrome browser and I finally got my confiquered pc and printer. He is an all-in-one 2840 color laser jet. How do I get the scan and fax utilities to perform?
It is useful to include the manufacturer and model number.
What version of Windows you have, including the service pack?
How the device is connected to your computer (USB, Ethernet, other)?
Have you installed the software that came with your HP Color LaserJet 2840 AiO printer?
If not, why? If you did, what error messages you are seeing? Please report messages completely, without paraphrasing.
Start here: HP Color LaserJet 2820 and 2840 AiO products Series - first installation and install
-
Windows mail - error and the same letter over and over again.
When I open Windows mail, I start to get the mail and I get it about 474 243. And then an error saying Windows mail will be closed because of an error. And I start it again and I get the SAME email AGAIN, and again, it stops somewhere and closes.
Anyone know what could be the problem?You can try to set up a new e-mail account and use the exact settings of the account that you have now. This way, you will have a copy of the same account. Then see if it has the same problem. If it works and is not old, and then see if the old man works after this and remove one of them, if you do not receive the messages in doubles.
If the new copy of account has the same problem, then it's a stuck message and your courier company should fix this.
Steve
-
In windows movie maker, failed to get the narration and music to play at the same time
Hello
I have followed the instructions to the T, but cannot get the narration and music to play at the same time.Hi Anataia,
You are unable to play the music and narration at the same time, you can adjust the audio levels to determine which audio will play louder than the other in your movie.
The audio settings by default in Windows Movie Maker is for the audio portion of imported video and any narration or music that you add to play at an equal level, but you can change that setting if it does not give you the balance that you want. To adjust the audio levels, follow these steps:
- Click on Tools, then the Audio levels.
- Do one of the following:
- To increase the level of audio on the Audio track that is part of a video clip, drag the slider toward Audio from video.
- To increase the level of audio that is located on the audio / music, drag the slider to Audio / Music.
- Click close.
http://Windows.Microsoft.com/en-us/Windows-Vista/add-narration-to-your-movie
Hope this has been helpful.
Bindu S - Microsoft Support
Visit our Microsoft answers feedback Forum and let us know what you think
Maybe you are looking for
-
Temperature CPU M40X-259?
Is it possible to control the temperature of the CPU of my M40X-259?I tried Everest and Notebook Hardware Control, both show only the HARD drive, temp.
-
Windows Update error number: 0 x 80248015
I have problems to download/install updates to Windows. I tried every fix I can think of and nothing works. This is the story of what I did. It is a new installation of Windows XP SP2 virtual machine. Here are the steps I've done (the first 3 are
-
I want to download windows 7 on a disk.
OT: Windows 7 download. I want to download windows 7 on a disk, but do not want the premium version. How can I find it and how much it will cost? Duane, the Office of the answer, but that doesn't sound right. Thanks for your help. Sondra
-
Can I open the files in .psd Photoshop elements on my Mac (OS El Capitan) 14?
-
I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content