Year Month Format
I have an input column value of Sep-15, i want to see output as 201509. what is the most efficient way to achieve it in SSIS 2008R2?
The source is Excel not SQL Sever.
Another option would be adding a Derived column and then use the following expression and add "20" + SUBSTRING(Date,5,2) to the below expression
SUBSTRING(Date,1,3) == "Jan" ? "01" :
SUBSTRING(Date,1,3) == "Feb" ? "02" :
SUBSTRING(Date,1,3) == "Mar" ? "03" :
SUBSTRING(Date,1,3) == "Apr" ? "04" :
SUBSTRING(Date,1,3) == "May" ? "05" :
SUBSTRING(Date,1,3) == "Jun" ? "06" :
SUBSTRING(Date,1,3) == "Jul" ? "07" :
SUBSTRING(Date,1,3) == "Aug" ? "08" :
SUBSTRING(Date,1,3) == "Sep" ? "09" :
SUBSTRING(Date,1,3) == "Oct" ? "10" :
SUBSTRING(Date,1,3) == "Nov" ? "11" : "12"
Narsimha
Similar Messages
-
Hi,
In report selection screen, I require a Year & Month parameter(YYYYMM or any year & month format), currently I am using NUM6 field and doing the validation manually using substring function to validate month & etc. Like to know whether any standard SAP domain/data element available... is there any way I can use some SAP standard functionality instead of doing it manually?
Thanks in advance.
Regards,
Balaji Viswanath.Hi,
PARAMETER: V_MONTH LIKE ISELLIST-MONTH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_MONTH.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
ACTUAL_MONTH = '200205'
LANGUAGE = SY-LANGU
START_COLUMN = 8
START_ROW = 5
IMPORTING
SELECTED_MONTH = V_MONTH
RETURN_CODE = V_CODE
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 1
HOLIDAY_CALENDAR_NOT_FOUND = 2
MONTH_NOT_FOUND = 3
OTHERS = 4.
Regards
Adil -
SELECT on year month only in '2013-Jan' format?
Hi,
is there a way of selecting on year month only in sql when the format of the date passed is '2013-Jan'. I'm not sure at the moment if I have any control of the date format passed so wanted to explore the sql options.
using sql server 2008 r2
thanks,Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements
in the DML. The report period table gives a name to a range of dates that is common to the entire enterprise.
CREATE TABLE Something_Report_Periods
(something_report_name CHAR(10) NOT NULL PRIMARY KEY
CHECK (something_report_name LIKE <pattern>),
something_report_start_date DATE NOT NULL,
something_report_end_date DATE NOT NULL,
CONSTRAINT date_ordering
CHECK (something_report_start_date <= something_report_end_date),
etc);
These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in
Sets / Trees and Hierarchies in SQL
Dear Celko,
You replied with this exact same answer, word for word, over three weeks ago. Look further up the thread of replies.
Thanks. -
Year-month-week selection screen format?
Hi experts,
I will create sd report but I need selection screen that includes year-month-week,
example;
Year : 2012
Month : March ( Listbox for all months )
Week : 1.week
I wıll execute report like that.
This report program is going to be comparison of weeks in specific years.
How can I achieve this selection screen ?
any help will be appreciate
best regardsHello Kutay,
This is an example of listbox.
PARAMETERS: listbox(1) AS LISTBOX VISIBLE LENGTH 10 DEFAULT 'N'.
AT SELECTION-SCREEN OUTPUT.
DATA:
name TYPE vrm_id,
list TYPE vrm_values,
value TYPE vrm_value.
name = 'LISTBOX'. " Name should be in UPPER CASE
value-key = '1'.
value-text = 'January'.
APPEND value TO list.
value-key = '2'.
value-text = 'February'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list
EXCEPTIONS
id_illegal_name = 0
OTHERS = 0.
Idem for week field.
I hope you help. -
Release Date for Albums Year, MONTH DAY
Why can't I enter the release date for albums (Year month and day)? Itunes has a field for year but that's it. I would have loved to be at the meeting where it was discussed.
"Year, month and day? why the heck would any want that?"
"Well a lot of us want to see our albums in chronological order and you can't do that with just the year, many albums come out every year"
"Blah Blah Blah, music is just to dance to, no one cares about dates, besides it would four extra digit fields in each entry"
But seriously, I would think that Itunes would aspire to be THE program for music lovers.
Instead of being able to just enter the release dates I have had to come up with my own work around. I put a the release date in the format yyyymmdd in fromt of each title and then sort by titles.
Now all of my Beatle albums finally show up in chronological order by release date. But why should I have to massage the data like this. I can't imagine what goes on at Itunes planning sessions. I'm very unhappy about the loss of cover flow but that's another story.I'm glad to hear that I am not the only one who sees this as a problem. And another Beatles fan too.
This is so fundamental. Every album has a release date and it's part of the data that is always associated with that album. Why did Apple look at the data available for an album and consciously decide to truncate it?
What kind of music lover isn't aware of when albums are released? I just don't get it.
I like having the date yyyymmdd in front of each album. It isn't pretty but it means the albums are chronological. If you want, you could just put this in the sort field and leave the regular album title in the regular field. Then the names would be right and they would sort correctly. But again. Why should we have to do all that?
Apple is busy constantly changing where the controls are on I tunes rather than fixing something simple and important like this.
Today I wanted to load some songs onto my ipod touch and it took me 10 minutes to figure out how to sync because the last itunes update got rid of the side bar.
How are you supposed to get comfortable using a product when they keep moving the controls around? Just quit apple. leave the controls where they are. Add new controls if needed but stop moving them. I know I'm ranting now but I am honestly angry and frustrated, -
FM to get the number of days in Year,month and days by giving number of day
Hi ALL,
This is quit differnt.
I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format.
for example.
start date :01.01.2009
number of days as 32
then i should get
years:0
months :1
days :1
Pleas help me out.hi Anusha,
first u pass the date and the days to the following fm you will get the result date....
data:date type sy-datum,
r_date(10) type c.
date = sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '32'
MONTHS = '0'
START_DATE = date
IMPORTING
RESULT_DATE = r_date
write:/ r_date.
then you need to pass the result date and the date to the following fm to get the required output...
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = r_date
date2 = date
IMPORTING
years = v_years
months = v_months
days = v_days
EXCEPTIONS
invalid_dates_specified = 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.
here u will get the difference in days, months and year...
i hope u wil get help from this...
regards
Ashu Singh -
How to set current year,month as default value in combo box
hi, im newbie of xcelsius user
i realize that hv a issue that display combo box base on year & month
let said
<b><u>step 1</u></b>
I create excel data like this
<b><u>year___ </u> </b> | <u><b>month_ </b></u> | <u><b>Product</b></u> | <u><b>revenue</b></u>
02-04-09 | 02-04-09 | a | $4,154
03-04-09 | 03-04-09 | b | $6,813
04-05-09 | 04-05-09 | a | $9,875
05-06-09 | 05-06-09 | b | $6,813
06-04-10 | 06-04-10 | a | $6,813
07-04-10 | 07-04-10 | b | $9,875
08-06-10 | 08-06-10 | a | $9,875
22-06-10 | 22-06-10 | b | $6,813
<u><b>Step2</b></u>
Then i go format cell to format/custom date to year & month
Eg1: Year u2013> 02-04-09 convert to u2018YYYYu2019 (2009)
Eg2: Month u2013> 02-04-09 convert to u2018mmmmu2019 (April)
So output like this
<u><b>year</b></u> | <u><b>month</b></u> | <u><b>Product</b></u> | <u><b>revenue </b></u>
2009 | April | a | $4,154
2009 | April | b | $6,813
2009 | May | a | $9,875
2009 | June | b | $6,813
2010 | April | a | $6,813
2010 | April | b | $9,875
2010 | June | a | $9,875
2010 | June | b | $6,813
But the problem is when i insert to combo box,use u201Cfilter Row u201D, i excpectation will display only 2009,2010
But Actual display the Year in combo box is duplicated :'(
so any solution ? and then only how to set current year & month as default value :'(
thanks,
regards
s1
Edited by: Leong Pui Kee on Feb 25, 2011 5:25 AM
Edited by: Leong Pui Kee on Feb 25, 2011 5:36 AMhi,
your created data
step 1
I create excel data like this
year___ | month_ | Product | revenue
02-04-09 | 02-04-09 | a | $4,154
03-04-09 | 03-04-09 | b | $6,813
04-05-09 | 04-05-09 | a | $9,875
05-06-09 | 05-06-09 | b | $6,813
06-04-10 | 06-04-10 | a | $6,813
07-04-10 | 07-04-10 | b | $9,875
08-06-10 | 08-06-10 | a | $9,875
22-06-10 | 22-06-10 | b | $6,813
In this, year and month both are same data, make the diffent data like year 2009, 2010 And month Jan, Feb, March, ...Etc
and also one more check you formulas on month and year, select correct source data, destination data for compoonent..
OR
from above, to create a date column and convert date-->year, date--> month and Explore it.
All the best,
Praveen -
About Calendar Year/Month in demo cube 0D_PU_C01
Dear Friends,
I'm now working with the demo cube <b>0D_PU_C01</b>,and then I met such a problem:
I download the csv file via a program, and then I found the stucture of the data is not suitable for this cube , so I changed it manually, and when I tried to load Calendar year/month colomn, It showed coversion error, so I reformatted it from <b>yyyymm</b> into <b>mmyyyy</b>, finally it works. But, when I open the report it shows in the following format: <b>mmyy/yy</b> (such as 0119/99, it should be 1999/01). Can anybody help me ?Hi Shi,
You need to write a small ABAP routine. If you are using PSA as the transfer method then you can write the routine in start routine section of the transfer rules tab.
You need to first bring the format to MMYYYY and then apply the conversion exit 'PERI6' (CONVERSION_EXIT_PERI6_INPUT) to convert the format to SAP internal format. That would resolve the issue.
Hope it helps,
Thanks
Soumya
Message was edited by:
Soumya Mishra -
Date separate year, month and day
Hello everyone and thanks in advance, I'm new to this and the truth is not doing this.
Well, I have a PDF with several pages which I designed and has been asking me in a complete date in the format dd / mm / yy and subsequent pages he asks me the same date of birth but in 3 separate fields, day , month and year. I want you when you enter the date the first copy and separate day month and year in others. I tried this but I get
var array_datesol = datesol.split("/")
var year = parseInt(array_datesol[2]);
var month = parseInt(array_datesoll[1]);
var day = parseInt(array_datesol[0]);
this.getField('yearsol').value = year;
this.getField('monthsol').value = month;
this.getField('daysol').value = day;
where is the initial field datesol date and year, month and day where they have to be separately
thanks in advanceAre you getting any errors in the JavaScript debugging console?
You are using the syntax for the 'Custom JavaScript calculation' and this syntax can not be used in the 'simplified field notation. Also you can not use any JavaScript properties, objects, functions, control statments.
When run in the console, I find you have a misspelling of the variable name 'datesol'. I also do not see where you are initializing the value for 'datesol'.
var datesol = event.valueAsString; // get value of this field
var array_datesol = datesol.split("/") ; // make into an array
this.getField('yearsol').value =array_datesol[2]; // get element year
this.getField('monthsol').value = array_datesol[1]; // get month element - fixed variable name
this.getField('daysol').value = array_datesol[0]; // get date element
I would use one of the following so the other fields are only updated when a date has been entered and the leading zeros are displayed:
this.getField('yearsol').value = '';
this.getField('monthsol').value = '';
this.getField('daysol').value = '';
if(event.value != '') {
// get parts of date and print with leading zeros
var datesol = event.value; // get value of this field
var array_datesol = datesol.split('/') ; // make into an array
this.getField('yearsol').value = util.printf('%,304.0f', array_datesol[2]); // get element year
this.getField('monthsol').value = util.printf('%,302.0f', array_datesol[1]); // get month element - fixed variable name
this.getField('daysol').value = util.printf('%,302.0f', array_datesol[0]); // get date element
// or
this.getField('yearsol').value = '';
this.getField('monthsol').value = '';
this.getField('daysol').value = '';
if (event.value != '') {
// get date parts and print with leading zeros
var oDatesol = util.scand('dd/mm/yyyy', event.value); // get date object
this.getField('yearsol').value = util.printf('%,302.0f',oDatesol.getFullYear()); // get element year
this.getField('monthsol').value = util.printf('%,302.0f', oDatesol.getMonth() + 1); // get month element - fixed variable name
this.getField('daysol').value = util.printf('%,302.0f', oDatesol.getDate()); // get date element
// or
this.getField('yearsol').value = '';
this.getField('monthsol').value = '';
this.getField('daysol').value = '';
if(event.vaue != '') {
// get parts of date and format
var oDatesol = util.scand('dd/mm/yyyy', event.value); // get date object
this.getField('yearsol').value = util.printd('yyyy', oDatesol); // get element year
this.getField('monthsol').value = util.printd('mm', oDatesol); // get month element - fixed variable name
this.getField('daysol').value = util.printd('dd', oDatesol); // get date element
If you are going to fill other field, you will need to use the '.valueAsStriing' property or '.toString()' method to retain the leading zeros. -
Generation on Year Month By SQL
Respected Freinds,
I want to generate list of Year Months in format of YYYYMM by using sql query which will
produce output like, depending on the given starting YYYYMM and Ending YYYYMM
suppose if i give startin YYYYMM as 200801 and ending YYYYMM as 200912 ....
YYYYMM
200801
200802
200803
200804
200912If you have REAL dates as input (you don't mention the datatype of your input), you could:
SQL> with dates
2 as(
3 select to_date('200801', 'yyyymm') startdate
4 , to_date('200912', 'yyyymm')enddate
5 from dual
6 )
7 select to_char(add_months(startdate, level-1), 'yyyymm')
8 from dates
9 connect by level <= months_between(enddate, startdate)+1;
TO_CHA
200801
200802
200803
200804
200805
200806
200807
200808
200809
200810
200811
200812
200901
200902
200903
200904
200905
200906
200907
200908
200909
200910
200911
200912
24 rows selected. -
Cal.Year/ Month - Applet - MM.YYYY and HTML- MMM.YYYY
Hi All.
I have created Webi Report on top of Bex Query.
While running the webi report Cal.Year/ Month Prompts list of vales showing format as MM.YYYY (01.2014) in Applet version.
and running the same report with HTML version, Cal.Year/ Month Prompts list of vales showing different format as MMM.YYYY (Jan.2014).
I have checked at bex Q level Cal.Year/ Month variable have List of values MM.YYYY (01.2014) format.
Cal.Year/ Month - @
Bex Q : MM YYYY
Applet - MM.YYYY
HTML- MMM.YYYY
Need to understand same report Cal.Year/ Month Prompts list of vales showing different format (Applet - MM.YYYY. HTML- MMM.YYYY).
is there any way to fix the issue display same format in the both version.Hi Sateesh,
Thanks for reply.
Are you using Unv /BICS ? BICS
Did you checked both applet and HTML version with the same user ? Yes, Same user
HTML and Applet version report pointed to same BO and BW system ? Yes, Both BO and BW systems are same. (development systems)
In BEx , variable values shows both text and key and when value selected it only show key in the entry field box .- Yes, bex variable and characteristic defined display as KEY.
I have created Cal.Year/ Month Prompts at webi level….while refresh the report. Cal.Year/ Month Prompts list of vales showing different format (Applet -MM.YYYY (01.2014). HTML- MMM.YYYY (Jan.2014)). -
Getting year, month and date
I am getting the current year, month and date as follows:
public void setDate(Date date) {
String strDate = "";
//year
Calendar cal = Calendar.getInstance();
cal.setTime(date);
strDate += cal.get(Calendar.YEAR);
//month
strDate += cal.get(Calendar.MONTH) + 1;
//date
strDate += cal.get(Calendar.DATE);
this.date = strDate;
}This gives me the date in teh format yyyymd.
i.e for Mar 5 2007, it returns 200735
How can it retrieve it in yyyymmdd format?
i.e. Mar 5 2007 must be 20070305use the function:
private String getTwoNumberFormat(int i){
if (i<10)
return "0"+i;
else
return ""+i;
}and then call
//month
strDate += getTwoNumberFormat(cal.get(Calendar.MONTH)+1);or use SimpleDateFormat :) -
I have paid for Creative Cloud - illustrator CC 1 year monthly plan, but it still show "Trial Expired". I have tried to sign in and sign out creative cloud many times, but still can't work. Please help!
Does your Cloud subscription show on your account page?
https://www.adobe.com/account.html for subscriptions on your Adobe page
Also,
This is an open forum, not Adobe support... you need Adobe support to help
Adobe contact information - http://helpx.adobe.com/contact.html
-Select your product and what you need help with
-Click on the blue box "Still need help? Contact us" -
Scheduling Agreement –delivery date in month format - MD04
Dear experts,
Scheduling Agreement, forecast delivery schedule.
When I enter a delivery date in month format, the system, during processing, automatically checks the factory calendar and proposes the first valid working day as the delivery date. ( Yes. I know it is a SAP standard )
My requirement is automatically checks by the system the last working day as the delivery date.
Could you tell me what are the settings i need to check to resolve this issue?
Thanks in advance
arturAs pointed out already above you need to use a periodic lot sizing procedure.
Use Lot sizing procedure P, Lot size indicator K and Scheduling =2
As per your requirement, you need to create a calendar using MD25 with Months (Workdays) as a calculation rule with 1 as the period in the box provided.
After a MRP run the delivery date would point to the last day of the month.
But the requirement is a bit surprising as say for a requirement on the 1st of the month you will have the delivery showing up on the last day of the same month. Under what circumstances do you have this requirement as a valid one in your business case? -
Unable to view the Calendar Year/Month in the Query
Hi All,
We are having a standard query on Customer InfoCube 0sd_c01_q0003.
I was able to get the data. But I am unable to view the Calendar Year/month. In that place I am getting '#'.
I am able to view the details in the InfoCube. There aren't any errors while executing the error.
Regards
YJhi,
U r Problem is not clear...if u r getting # for characteristic values means..u don't have data in Infoprovider...try to view data in InfoProvider with the same selections that u r executing the Query with.
thnaks
Maybe you are looking for
-
PDF to TIFF error: Image is too wide to output Acrobat X Pro
I have been using Adobe Acrobat X Pro to convert PDFs to TIFFs. All of the sudden this week I am getting an error saying the Image is too wide to convert. These are files I previously converted without a problem. I am specifying resolution of 36
-
Hi, my customer would like to implement a common business practice for ERP QM module - used in a pharmaceutical company. Are there any Best practice scenarios or BC objects to cover that area (specially for pharma) Thanks, Tomaz
-
Hi, I have just installed the Lightroom 5 trial on my macbook pro (running mac osx 10.7.5) The programme refuses to launch and the crash report says Application Specific Information: objc[3921]: garbage collection is OFF *** Terminating app due to un
-
I was wondering how you would do something like this?
Hi i was wondering how you would do something like this? i recently got photshop CS5 and wanted to do something like this!
-
My facebbok app got stuck so I deleted it. I reinstalled it but it's not appearing but the app store says it is installed.