SQL & PL/SQL :: Report Deign To Generate Month Wise Sale - Date Format

Sep 23, 2013

how to write pl/sql to create date o/p like .

since we wnat to design pl/sql report wich will generate monthwise sale from 01jan2009 to 01-sep-2013.

we have created funtion wich will accept argument as employee no, from date and to date.

from_date to_date
01-JAN-2009 01-FEB-2009
01-FEB-2009 01-MAR-2009
01-MAR-2009 01-APR-2009
01-APR-2009 01-MAY-2009
01-may-2009 01-JUN-2009
01-JUN-2009 01-JUL-2009

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Date Format With Zero Excluded From Month

Sep 20, 2010

i have a requirement where i have to exclude the zero from the month e.g jun=06 but i require 6 only not zerodec=12 i require 12

Do we have any format in oracle which support this.

View 3 Replies View Related

Get Month Number From Date Format

Oct 31, 2012

I am trying to get the month number from this date format '19-OCT-12' . when i try to run the below statement i am getting an error like "not a valid month"

select to_date('19-OCT-12','MM') from dual

i need to get value as 10

View 4 Replies View Related

SQL & PL/SQL :: How To List Data Dynamically Month Wise Picking Month From The Same Table

Jun 4, 2013

I have a requirement to list the data month wise dynamically where month data is also in the same table, hopefully the below posts should bring more clarity to my requirements.

1. Table creation:
Create table T1 (account_no varchar2(15), area_code varchar2(2), bill_month date, consumption number);

2. List table content:
select * from T1;

account_no area_code bill_month consumption

Q00001Q31-Jan-12125
Q00002Q31-Jan-1265
Q00003Q28-Feb-12219
Q00004Q28-Feb-12805
Q00005Q28-Feb-1254
Q00001Q31-Mar-12234
Q00002Q31-Mar-12454
Q00003Q31-Mar-12232
Q00004Q30-Apr-1221
Q00005Q30-Apr-12218
Q00001Q30-Apr-1254
Q00002Q31-May-1219
Q00003Q31-May-1287
Q00004Q30-Jun-12187
Q00005Q30-Jun-1278
so on......so on......so on......so on......

3. Expected output:
account_no area_code Jan-12 Feb-12 Mar-12 Apr-12 May-12Jun-12Jul-12Aug-12Sep-12Oct-12Nov-12Dec-12

Q00001 Q 125 548 2345487423154821518738721512
Q00002 Q 65 127 45487819357831585683152878
Q00003 Q 545 219 2328738735188745897313
Q00004 Q 78 805 1221218187885718387389787138
Q00005 Q 541 54 2621878778386538698182

With the conventional query I hope this is impossible,

View 2 Replies View Related

Generate Oracle Report And To MS Word Format?

May 25, 2011

I would like to generate oracle report and to MS word format? new xml format of MS office?

View 2 Replies View Related

PL/SQL :: How To Get Max Total Sale By Date On Every Store

Jul 6, 2013

I am trying to write a query in Oracle which will return both the store_id and the maximum total sale by date

View 3 Replies View Related

SQL & PL/SQL :: Day Wise Count In A Month

Jul 1, 2011

I want to get the current month day wise count. I dont want Procedure. I need SQL Query only.For example:

July 2011.
Sunday - 5
Monday - 4
Tuesday - 4
Wednesday- 4
Thursday - 4
Friday - 5
Saturday- 5

View 3 Replies View Related

SQL & PL/SQL :: How To Get Month Wise Data

Sep 11, 2012

I have data something like this.

Employee_id date_loggedin

123 09/10/2012
134 09/03/2012
111 09/02/2012
123 08/27/2012
134 08/01/2012
123 07/06/2012
111 05/11/2012
123 07/04/2012
123 07/03/2012
123 03/15/2012
123 01/11/2012

The desired output for input of employee_id=123 and dates between 01/01/2012 and 09/30/2012

Month login_count
JAN_2012 1
FEB_2012 0
MAR_2012 1
APR_2012 0
MAY_2012 0
JUN_2012 0
JUL_2012 3
AUG_2012 1
SEP_2012 1

View 2 Replies View Related

PL/SQL :: Month Wise Break

May 4, 2013

I have a requirement as follows :-

The user will submit the start date and end date. Based on the date parameters, the customized procedure should do some calculations month-wise.

For eg : start date - 01-Dec-2012 to end date - 31-Mar-2013

I want the break up as
Start date End date
01-dec-2012 31-dec-2012
01-jan-2013 31-jan-2013
01-feb-2013 28-feb-2013
01-mar-2013 31-mar-2013

How can i achieve this month-wise break ?

View 6 Replies View Related

SQL & PL/SQL :: Month Wise Days For Between Given Dates?

Apr 28, 2010

I have a table with starting date and ending date.

I want to fetch monthwise days for given two dates

IE starting 25/12/2009 ending 25/03/2010

Result should like below.

Dec-09 7
Jan-10 31
Feb-10 28
Mar-10 25

I have tried this but it is not giving me the result which want..

select to_char(thedate,'mon-yy') mnth,count(to_char(thedate,'mon-yy')) days from
(SELECT TRUNC(to_date('25/12/2009','dd/mm/yyyy'),'Y')+ROWNUM-1 THEDATE
FROM ( SELECT 1 just_a_column
FROM dual
CONNECT BY LEVEL <= 366

[code].....

View 3 Replies View Related

Growth Of Database Month Wise?

Feb 24, 2013

how to find out growth of database month wise?

according to me, v$datafile can be use to know growth in database in terms of datafiles added in past months as per creation_time. but hows about those existing datafiles whose size has been re size more .

Whats your inputs on this ??

View 21 Replies View Related

SQL & PL/SQL :: Required Data For Month To Date And Year To Date?

Apr 30, 2012

I want to get data for month to date. For example, If I pass today or any day date as parameter then i should get data for that month(month of passing date) up to passing(parameter) date. As well as i have to get year to date.For example, If I pass today or any day date as parameter then i should get data for that financial year(year of passing date) up to passing(parameter) date. how to get month to date and year to date data.

View 3 Replies View Related

Forms :: How To Make Demand Wise Report

Jul 3, 2013

I have a payment table that has the ids of cds that has being sold in the past month. From there I want to make a demand wise report. I am aware of the report wizard in the oracle forms but I dont want to use it. Here are the tables in a bit more details.

payment: id_cd, price, dateofsell
cd_details: id_cd, name, price, language.

View 6 Replies View Related

Reports & Discoverer :: Parameter Wise Report Content

Jan 10, 2012

I developed a report for bar code and it is running well.the contents in one bar code are Item name,code,price.I designed 4 pieces in a page and generate also 4 pieces in a page.

But Now I want to generate the report with a parameter where I can mention how many copies of bar code will generate in a page for this specific item.

If I put 3 pieces in parameter then bar code will generate 3 pieces. or so and so.

View 1 Replies View Related

Forms :: Prevent Duplicate Record Entry Date Wise?

Oct 10, 2011

we have a table attendance_d with no constraint which have duplicate emp_id we want to stop duplicate emp_id on the same date. if employee's record already entered in today's date then duplicate Error message must show if he tries again to enter the same record. for this i have written the following code but it is not working date wise some body. i want to use on WHEN VALIDATE ITEM TRIGGER in oracle forms 6i.

DECLARE
l_count NUMBER;
BEGIN

[Code]....

i have tried my best to format the syntax of code but in preview it showing like as above i have formated in toad by using the key ctrl+shift+f.

View 2 Replies View Related

Visual Studio :: Set Query Window Default Date Format To Full Date?

Oct 24, 2013

When I run a query form the the Query Window in Visuial Studios 2012 all the date fields truncated to 'mm/dd/yyyy', but i need the full date returned. I am able to get full date from  TO_char(MyDateField, 'yyyy-mm-dd hh24:mi:ss'), but if I do TO_DATE(MyDateField, 'yyyy-mm-dd hh24:mi:ss')  it only returns  'mm/dd/yyyy'. I'm sure this is a simple setting in Visual studios but I cant find it to save my life. Is there there a way to have the full date returned by default?

View 0 Replies View Related

Forms :: Date Field Gets Disabled When Date Format Is Given?

Oct 3, 2012

A field named xxx_date is a text item which we have to enter manually so as to update a record in that particular date. This is a mandatory field without which we cannot continue the data entry..

I am getting this error while trying to update the record

FRM-40509 :Oracle error :unable to update record

I have kept the enabled = yes
required=no
data type=Date.. in the property pallet

View 2 Replies View Related

PL/SQL :: Reset Date In Specific Format (Date / Time)

Dec 23, 2012

I want to reset my date to this format: 12/31/2012 11:59:59 PM - see code below:

DECLARE
v_latest_close DATE;
BEGIN
v_latest_close := TO_DATE ('12/31/2012 23:59:59 ','MM/DD/YYYY HH24:MI:SS');
DBMS_OUTPUT.PUT_LINE('The new date format is : '|| v_latest_close);
END;

the code above displays only : 12/31/2012 instead of 12/31/2012 11:59:59 PM

View 4 Replies View Related

PL/SQL :: How To Get Min Date Of Every Month For Six Months

Mar 25, 2013

I have data like this.

Process_date SEQ_No
------------- ---------
16-MAR-13     733
09-MAR-13     732
02-MAR-13     731
24-FEB-13     730
16-FEB-13     728
09-FEB-13     727
02-FEB-13     726
26-JAN-13     725
21-JAN-13     724
12-JAN-13     723
05-JAN-13     722
29-DEC-12     721
24-DEC-12     720
15-DEC-12     719
08-DEC-12     718
03-DEC-12     717
22-NOV-12     716
17-NOV-12     715
10-NOV-12     714
03-NOV-12     713
29-OCT-12     712
23-OCT-12     711
13-OCT-12     710
05-OCT-12     709
28-SEP-12     708
22-SEP-12     707
15-SEP-12     706
08-SEP-12     705
01-SEP-12     704

every month admin will refresh actual data table and automatically this above table will update with unique seq_no and process_date.

I need to extract min date of every month(First refresh of last 6 months - excluding current month) and also seq_no related to that month so using joins(using seq_no - that is available in main table) i can combine actual data.

I need result like:

02-MAR-13     731 ( I don't need MAR as it should not take current month data)

so i need final result like below:

02-FEB-13     726
05-JAN-13     722
08-DEC-12     718
03-NOV-12     713
05-OCT-12     709
01-SEP-12     704

View 8 Replies View Related

Specify Month Start And End Date In Query?

Oct 27, 2008

I want a monthly report where the month wise sum of qty should be displayed in a row for last 12 months. I need to specify the month start date and end date in the query to pick the sum for the particular month. How can i do it in a SQL query?

SUM(decode(to_char(t1.trx_date,'mm/rrrr'),
to_char(add_months(SYSDATE,
-1),'mm/rrrr'),
nvl(t2.quantity_invoiced,
0))) AS qty_01
from t1,t2
where t1.col1=t2.col1

instead of sysdate i have to use start and end of month. Also i am using group by clause on some columns.

View 1 Replies View Related

Date Search By Last Week / Month?

Nov 2, 2011

I have a create a report for our dept with certain criteria. So far what I need is a report that shows last weeks numbers or sign ups. I can't get the date search or between to work.

What I need is one for month end and one for last 7 days.

here's what I have so far.

select ap.name

to_char(ap.opendate,'MM-DD-YY') "Open Date"

from [databasname]

where ap.opendate between databasename-7 and databasename-1

I really don't want to change the date myself I want the system to know when the 7 days or month is.

View 4 Replies View Related

SQL & PL/SQL :: ORA-01839 - Date Not Valid For Month Specified?

Nov 1, 2013

our web application has a field DATETO which has no validation (end date). So user can put garbage there. In this field should be SYSDATE + max. 2 years. But also SYSDATE + 1 month OK.

I need to make a script that sets for example "31.12.9999" to null. Because so long end date is non sense.

SQL> SELECT EXTRACT (YEAR FROM (TO_DATE (DATETO, 'DD.MM.YYYY')))
FROM XXX_USER_JC_ORDERID
WHERE DATETO IS NOT NULL;
ERROR:
ORA-01839: date not valid for month specified

no rows selected

Littlefoot writes about ORA-01839 "It usually happens when invalid dates are used, such as 30th of February"[URL]..

I don't see invalid date???

SQL> SELECT DATETO
FROM XXX_USER_JC_ORDERID
WHERE DATETO IS NOT NULL;
DATETO
--------------------------------------------------------------------------------
23.09.2013

[code]...

DATETO
--------------------------------------------------------------------------------
31.12.2014
31.12.2016
31.12.2013
31.08.2014

[code]...

View 7 Replies View Related

PL/SQL :: Calculate Financial Month From Date

Mar 28, 2013

I need a pl/sql function to calculate the financial month from an date... For eg. If i enter input date as '21-sep-2012' the function should return me the output value in months as 6. so it should calculate from april to september of that year...

View 13 Replies View Related

SQL & PL/SQL :: Generate A CSV Report?

Feb 18, 2012

I have a requirement to generate a report in csv file, attached scripts, sql query and actual output and expected output.

In the query, I am hard-coding month&year, when I run in march 2012 it should include march 2012 in output (similarly for every month going forward), to do that I have to modify my query to include march 2012 & preceding months in every individual query, this report needs to be generated once every month.

I am looking for a generic solution which does not need to be modified every month, also in the output,under "Mail File" data should be in ascending order, in the "Total Mailed" all the months should have grand total.

oracle version : 10.2.0.1.0

View 25 Replies View Related

Split Date Column Into 4 Month Periods

Feb 11, 2011

I have a table having a code column A and a date column D1 which represents the days when the code was inserted. I can have more then 1 date for a code.

The idea is to create another column (an id) which will correspond to all the inserted days of a code for a period of 4 month. if, after 4 month of the first insert, another records appears, then another id will be generated for my code. If a code has the date included in one of the intervals existing already, then it will just receive the corresponding id.

Example:
id code date
id1 cd1 01/01/2010
id1 cd1 04/03/2010
id1 cd1 22/04/2010
id2 cd1 27/05/2010
id2 cd1 21/06/2010

If a cd1 appears now on 22/05/2010, then i have to give it id2.

View 3 Replies View Related

SQL & PL/SQL :: Date - How To Get Past 12 Months From Current Month

Dec 17, 2011

I need to get the past 12 months from the current month

for example

input:

march2010

output:

apr2009
may2009
june2009
july2009
augest2009
september2009
october2009
november2009
december2009
january2010
february2010

View 23 Replies View Related

SQL & PL/SQL :: How To Sort Date By Month (JAN) And Year (2009)

Jun 4, 2010

I've done this once before, but can't seem to find the sql.

How can I sort by month and year on a column called ex: TEST_dATE

JAN 2007
FEB 2007
APR 2008
SEP 2009
OCT 2009
FEB 2010
JUN 2010

View 15 Replies View Related

SQL & PL/SQL :: Find Out Date Difference In Day-month-year?

Jul 8, 2010

i want to find out difference between two dates in day-month-year. How can i do it?

For example how many days,months are years are between '01-jul-1979' and '08-jul-2010'

View 4 Replies View Related

SQL & PL/SQL :: Date Diff (Month Not Day) Equivalent In Oracle

Jun 16, 2010

I see month aging buckets in the Oracle Application I am using (Keystone time and billing). I need to do a query in directly in Oracle (Toad front end to Keystone database) using month aging buckets . I use the following in Access that matches the results in Oracle, but I need to work directly in Toad because I want to avoid having to bring over all the dates when I want to summarize by buckets.:

2-4 Months: Sum(IIf(DateDiff("m",[invoice date],forms!Reporting_Standard!txtlastdayofmonth) In (2,3),[Outstanding Gross],0))

I know about getting the difference between two dates and that works fine for day aging buckets, but I need months, which can deal with months that are different sizes.

View 3 Replies View Related

PL/SQL :: Insert Only Month And Year Instead Of Full Date

Oct 8, 2012

select b.penjara_id, p.penj_lokasi, a.no_daftar, b.episod, b.nama1,to_char(a.trkh_mula_prl,'dd/mm/yyyy') as trkh_mula_prl, to_char(bulan_proses,'mm/yyyy') as bulan_proses,
        b.epd, b.lpd
from prl_daftar_proses a, senarai_pesalah b, penjara p

where a.no_daftar=b.no_daftar
and a.episod=b.episod
and b.penjara_id = p.penjara_id
and a.setuju_jplp is null
and a.bulan_proses between to_date(:FROM,'dd/mm/yyyy') and to_date(:TO,'dd/mm/yyyy')
order by b.penjara_id, a.bulan_proses,a.no_daftarHi,

how i can insert only month and year from the value that have full date in the database?

for example,the date is 09/18/2012, but i just want to insert 09/2012 as parameter. If i want to insert only one parameter, i can do that..But i have problem when I want to insert two parameters..

View 16 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved