Help with calender dates
Hello every one
I have a table with calender dates and there is a indicator which says if it is a working day or an holiday. Is there a way I can write a procedure that will help me fill that indicator column based on the calender dates.
My table looks something like this
date indicator
01/01/2011 Holiday
01/02/2011 working day
01/03/2011 working day
12/31/2011 working day
Good Friday or Easter Monday as a holiday I can't help you with that.
here is easter both julian and gregarian
WITH years AS ( SELECT 1989 + LEVEL yr
FROM DUAL
CONNECT BY LEVEL <= 30)
SELECT TO_CHAR (TO_DATE (day || ' ' || month || ' ' || yr, 'DD MM YYYY'),
'DD MON YYYY')
easter_day_julian,
TO_CHAR (
TO_DATE (day || ' ' || month || ' ' || yr, 'DD MM YYYY') + 13,
'DD MON YYYY')
easter_day_gregorian
FROM (SELECT yr,
a,
b,
c,
d,
e,
FLOOR ( (d + e + 114) / 31) month,
MOD (d + e + 114, 31) + 1 day
FROM (SELECT yr,
a,
b,
c,
d,
MOD ( ( (2 * a) + (4 * b) - d + 34), 7) e
FROM (SELECT yr,
a,
b,
c,
MOD ( (19 * c + 15), 30) d
FROM (SELECT yr,
MOD (yr, 4) a,
MOD (yr, 7) b,
MOD (yr, 19) c
FROM years))))Edited by: pollywog on Nov 24, 2010 2:06 PM
Similar Messages
-
Need help with saving data and keeping table history for one BP
Hi all
I need help with this one ,
Scenario:
When adding a new vendor on the system the vendor is suppose to have a tax clearance certificate and it has an expiry date, so after the certificate has expired a new one is submitted by the vendor.
So i need to know how to have SBO fullfil this requirement ?
Hope it's clear .
Thanks
BonganiHi
I don't have a problem with the query that I know I've got to write , the problem is saving the tax clearance certificate and along side it , its the expiry date.
I'm using South African localization.
Thanks -
I'm creating a jscript to automatically rename a file the current days date, but i can't figure out how to get it to put a zero in front of days/months that are single digits. Can anyone help me real quick? Heres the code i already have, pay no attention to the "dh" part, it has to be there:
var todayFileName = "dh" +
today.getFullYear() + "" +
today.getMonth() + "" +
(today.getDate()+1); + " " +This little javascript function should help.
Note that it is only meant to work with valid dates. Putting in a -7 for the parameter will result in something not so nice :-)
function twoDigitNo(no){
return (no < 10) ? "0" + no : no;
}Cheers,
evnafets -
Need help with enhanced data source in Production system
Hello Gurus,
1. I enhanced a datasource in BW and populated the field using customer exit using CMOD function. In Dev system, i dont have much data, so I deleted the whole data and did full load.
what shud I do in Production side, so that Delta wudnt be affected??since in production, we have millions of records, we wont do full load., what is the best way to populate the field in production after transporting the datasource to production without disturbing delta's, to reflect the new field for previous years data???
2. can we put 0customer and 0material in the same dimension?? how its going to affect the performance?
Thanks in advance.,
Best Regards,
PavanHi,
Please see this
1.
see this thread
populated the new field with historic data
2. can we put 0customer and 0material in the same dimension?? how its going to affect the performance?
Its better not to use them in a single dimension because one customer and take more than one material so if you have 100 customer and 1000 materials this combination will generate a large number of records. Its always better to keep characteristic which are having 1:N relation ship in one dimensional in you case customer and material will have an M:N type of relationship.which will result in slow performance.
Regards,
Ravi -
Need help with Rollback data if there is error in Data load
Hi All,
We are trying to load data to Oracle 11g database. We want a trigger, procedure or something like that to rollback the data if there are errors in load. Is it possible to do rollback after all the records has been parsed ? So if we try to load 100 records and if there are 30 records with error, we want to rollback after all the 100 records are parsed.
Please advice.>
Thanks for the suggestion. I'll try that option. So currently we are only loading data that is validated and erroneous records are rejected using trigger. So we don't get any invalid data in table. But Now users are saying that all the records should be rejected if there is even one error in the data load.
>
I generally use a much simpler solution for such multi-stage ETL processes.
Each table has a IS_VALID column that defaults to 'N'. Each step of the process only pulls data with the flag set to 'Y'.
That allows me to leave data in the table but guarantee that it won't be processed by subsequent stages. Since most queries that move data from one stage to another ultimately have to read table rows (i.e. they can't just use indexes) it is not a performance issue to add a predicate such as "'AND IS_VALID = 'Y'" to the query that accesses data.
1. add new unvalidated data - automatically flagged an invalid by default of 'N" on IS_VALID column
2. run audit step #1 - capture the primary key/rowid of any row failing the audit.
3. run audit steps #2 through #n - capture error row ids
4. Final step - update the data setting IS_VALID to 'Y' only if a row passes ALL audits: that is, only if there are NO fatal errors for that row captured in the error table.
That process also allows me to capture every single problem that any row has so that I can produce reports for the business users that show everything that is wrong with the data. There are some problems that the business wan't to ignore, others that can be fixed in the staging tables then reprocessed and others that are rejected since they must be fixed in the source system and that can take several days.
For data that can be fixed in the staging tables the data is fixed and then the audit is rerun which will set the IS_VALID flag to 'Y' allowing those 'fixed' rows to be included in the data that feeds the next processing stage. -
Help with Inconsistent data from NI6211
I'm not getting very far with establishing good data transfer from an NI 6211 and don't seem to be able to pin point the issue or get confidence from DasyLab V10 to be able to look for the problem in another area.
The NI6211 is set for period measurement and automatically uses a low frequency counter with sample on demand. The measurement range is set for 200ms to 1ms
The Dasylab Counter Input task displays the sample on demand and block size of "1".
I have also selected "10" as an output after timeout of 5seconds.
I have set the module to use the Dasylab timebase and have configured all 3 timebases for 1000Hz and (tried higher and lower values) and set block sizes to 1.
Whenever I change the timebase setting I always carry out a synchronise with MAX.
I have been writing to a file using time deducted from data.
With these settings I have the value "10" generated and stored in the file.
When it says "Output after timeout (s) of:", does this mean that their has been no communication for 5seconds even though I can get time stamp information indicating only a few milliseconds have passed?
Does time deducted information mean time deduced information (ie. time stamp from the data)
Is there anything I need to do with A/D window? I have changed the sampling rate in there but it only appears to change the driver setting.
Any help much appreciated.
Thanks
Mark..Additional to information in above post, the operating system is Windows Vista Home Premium with Service Pack 1.
Could this be the underlying issue, Dasylab and Windows Vista are untested?
Thanks -
Help with exporting data from pdf form
I have about 100 pdf forms that I created in adobe forms central and distributed as a pdf form (rather than on the web). I am trying to export the data into a spreadsheet but when I export it, the fields are all jumbled in the csv file, as in they are not in the same order. I need to export the data all together so I'm going to the forms menu and selecting "manage form data" and then selecting "merge data files into spreadsheet". I tried exporting a single file but that gave me something really weird.
Please help, I have a deadline next week to analyze this data and can't make sense of it once it is exported to a spreadsheet.Would you please share your form with me and send me one of your pdf forms and some of the csv files?
You can share your form by doing the following:
1. Click on the “Share” icon on the bottom left corner.
2. Click on “Add Collaborator” on the popup menu.
3. Enter [email protected] under “People to share with”.
4. Set subject to "Export data from pdf form"
5. Click the “Share” button on the bottom right of the dialog.
Thanks
Ken -
Help with multiple date percentage report
Dear all,
I am having problems with getting percentage right on my report which is set to YTD however I am counting records for Last 5 days, Last 4 weeks and Current Date.
I am getting the records perfectly right as I have created 3 different Groups for them. The Running Totals are counting the correct number of records.
As I have two Running totals for each job (Credit Job + Free of Charge Job), these two jobs are getting added up in the report.
For example
YTD formula
Running total of Credit Job + Running Total of Free of Charge Job = Total Jobs
Last 5 Days formula
Running total of Credit Job + Running Total of Free of Charge Job = Total Jobs
Last 4 Weeks formula
Running total of Credit Job + Running Total of Free of Charge Job = Total Jobs
Current Date formula
Running total of Credit Job + Running Total of Free of Charge Job = Total Jobs
To get the grand total of these records, I have created another formula which counts all the above YTD records, L5D records and displays them in the report footer. Grand Total is showing up correctly.
Now, What I want is the percentage of each record, i.e. the percentage of YTD records, L5D records etc.
I have created a formula which counts the percentage but incorrectly.
Here is the formula
Whileprintingrecords;
Numbervar b:=0;
numbervar n:=0;
numbervar m:=0;
b:={@TotalJobsFOCRL5D}; // this is total job, (Credit+Free of charge jobs)
n:={@TotalJobsFOCRL5DGT}; //GT is the grand total showing in report footer
If b=0 then 0 else //if total jobs = 0 then answer is 0
m:=(b/n)*100; // divide total jobs with grand total
totext(m,2)+"%"; //show as percentage
This formula does show the percentage but divides each job by itself. So if Total Jobs = 9 then it shows 100% whereas Grand Total is 479.
Could someone please help me getting the correct percentage.
The percentage formula is placed on the respective group footer.
Regards
Jehanzebclosing no reply
-
Need help with converting date format to decimal in SSRS expression.
Hi all,
I have a decimal data type column with a record in the following format 20150219 --> yyyyMMdd. And I am trying to convert the return value from SSRS date/time parameter to a decimal value.
The TMDTOP column is the decimal data type with date records in yyyyMMdd format.
My return parameter is the following:
=IIf(IsNothing(Parameters!SystemDate.Value),Fields!TMDTSY.Value,CDec(Format(Parameters!SystemDate.Value,"yyyyMMdd")))
When I try to run the report I get the following error:
Failed to evaluate the FilterValue of the DataSet ‘DataSet1’. (rsFilterEvaluationError)
I appreciate if anyone can help me on solving this problem.
Thanks in advance.why casting date to decimal here? Can you explain?
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Need help with recovering data from a truecrypt HDD
I have done something stupid, I have run fdisk on my truecrypt hdd by mistake, and created 2 new partition. the 1st one on 67mb and the 2sd for the rest of the hdd.
Can someone plz help me with restoring the data? I am not really sure there to begin.Get testdisk. I use Parted Magic to recover partitions with Testdisk. So long as you can decrypt the resurrected partitions AND provided you have NOT written to those two partitions after they were fdisk'ed you should be able to recover from this mess. I really recommend PartedMagic for this sort of thing only because it has a good interface and a lot of other tools in one place.
Testdisk isn't hard to use and there are mini-tutorials out there if you're really stuck such as these links from our wiki:
Testdisk and Photorec -
Please help with: A date split into 3 Combo Boxes ....
Can someone help me with this Please?
I have a date for a Date of Birth i.e. dd/MM/yyyy
I need to split it up an place it into 3 combo boxes i.e. Day Combo, Month Combo and Year Combo.
This is the code I have to set the combo boxes, now I need to bring it back into the combo boxes.
can someone help me with the code as I need to have this finish on friday and I am running out of time. I just dont know what to do PLEASE SOMEONE HELP...
Thanks
Craig
// List days
private void DayOfTheMonth(int highNumber,JComboBox comboBox){
comboBox.addItem(" ");
for (int index = 1; index < highNumber; index++) {
comboBox.addItem(String.valueOf(index));
private void DaySpecificComboBox()
DayOfTheMonth( 32, DayjComboBox);
// List Months
private void Month(){
MonthjComboBox.addItem("");
MonthjComboBox.addItem("January");
MonthjComboBox.addItem("February");
MonthjComboBox.addItem("March");
MonthjComboBox.addItem("April");
MonthjComboBox.addItem("May");
MonthjComboBox.addItem("June");
MonthjComboBox.addItem("July");
MonthjComboBox.addItem("August");
MonthjComboBox.addItem("September");
MonthjComboBox.addItem("October");
MonthjComboBox.addItem("November");
MonthjComboBox.addItem("December");
//List Years
private void Year(int highNumber,JComboBox comboBox){
comboBox.addItem(" ");
for (int index = 2002; index > highNumber; index--) {
comboBox.addItem(String.valueOf(index));
private void YearSpecificComboBox()
Year( 1900, YearjComboBox);
private String StringFromDateFields(){
int month =1;
if (MonthjComboBox.getSelectedItem().equals(JANUARY))
month = 1;
else
if (MonthjComboBox.getSelectedItem().equals(FEBRUARY))
month = 2;
else
if (MonthjComboBox.getSelectedItem().equals(MARCH))
month = 3;
else
if (MonthjComboBox.getSelectedItem().equals(APRIL))
month = 4;
else
if (MonthjComboBox.getSelectedItem().equals(MAY))
month = 5;
else
if (MonthjComboBox.getSelectedItem().equals(JUNE))
month = 6;
else
if (MonthjComboBox.getSelectedItem().equals(JULY))
month = 7;
else
if (MonthjComboBox.getSelectedItem().equals(AUGUST))
month = 8;
else
if (MonthjComboBox.getSelectedItem().equals(SEPTEMBER))
month = 9;
else
if (MonthjComboBox.getSelectedItem().equals(OCTOBER))
month = 10;
else
if (MonthjComboBox.getSelectedItem().equals(NOVEMBER))
month = 11;
else
if (MonthjComboBox.getSelectedItem().equals(DECEMBER))
month = 12;
String
DOB = DayjComboBox.getSelectedItem()+"/"+String.valueOf(month)+"/"+YearjComboBox.getSelectedItem();
return DOB;Thanks for your time.
I could not get that to work ??
I have come up with this code whitch seams to work. Thought you may like to see it
String dobxml = xmlDoc.getValueOf(clientInfo, "DOB");
String dob = dobxml.replace('/', ' ');
System.out.println(dob);
StringTokenizer tokenizer = new StringTokenizer(dob);
String day = tokenizer.nextToken();
String month = tokenizer.nextToken();
String year = tokenizer.nextToken();
System.out.println(dob);
DayjComboBox.setSelectedItem(day);
MonthjComboBox.setSelectedIndex(Integer.parseInt(month));
YearjComboBox.setSelectedItem(year);ps thankyou
Craig -
Hi to all,
I load every day a customer hierarchy from R/3 in Infoobject 0Cust_slaes and from today i have not any values in the hierarchy.
After i run RSRV for 0cust_sales Hierarchies i got the following messge error :
The INCFL flag in SID table is missing for hierarchy leaf 3 with SID 3
The INCFL flag in SID table is missing for hierarchy leaf 7 with SID 7
The INCFL flag in SID table is missing for hierarchy leaf 9 with SID 9
The INCFL flag in SID table is missing for hierarchy leaf 5670 with SID 5670
RSRV does not give the opotion to correct error. How to resolve this ?
Thank you in advance all for your help, it is urgent for me,
-Panos.Hi,
Is there any processing running presently on the hierarchy table of That Info object. It looks as Dead lock problem. If no process is running(SM50) on this table, check for locks on this table in SM21. If you find any locks delete them manually and upload hte Hierarchy data one more time.
With rgds,
Anil Kumar Sharma .P -
Hi
How can I convert a string in 'YYYYMMDD' format to SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD HH24:MI:SS) to use in my SQL-query (for Oracle Database)
Thanks for your help
Praveen PadalaHi
How can I convert a string in 'YYYYMMDD' format to
SQL date (in the format 'YYYYMMDD' and also 'YYYYMMDD
HH24:MI:SS) to use in my SQL-query (for Oracle
Database)
Thanks for your help
Praveen PadalaI've done quite a few dates from Java to an Oracle DB. I like to use the SimpleDateFormat class in the java.text packadge.
import java.text.*; //Use this import
//In your class
SimpleDateFormat myDateFormatter = new SimpleDateFormat("dd-MMM-yyyy", new Locale("en","US"));
//The .format method returns a string. With this format string it can be included in an SQL command
myDateFormatter.format(myDate);
You can also use a SimpleDateFormat object with the format of your other dates to get a Date object that can be given to the SimpleDateFormat object set up to format in Oracle compatable form.
myDate is an object of type Date.
Hope this helps!
Kevin. -
Help with the date field!!! in opportunity
hello friends!!!!
I have a requirement that in opportunity tab milestone we have created date profile with 4 different date types and position them to milestone tab in opportunity header data.
Now the issue is out these 4, 2 of them we wish to have as mandatory fields
date type desciption
ZNOH_CONTSIG Date of signature
ZNOH_COSTART Contract Start Date
Can you please help how is that possible..
what procedure will it be behind this !!Hello Manuel Rodriguez
I have awarded you 6 points for your helpful answer as it didn´t solve my question posted here but a related issue was solved.
I tried to use the incompletness procedure and also the badi but in both the ways you can check for a field but in my case in opportunity tab milestone
it looks like an ALV with CRM concept it has date profiles behind that using date management in SPRO. Please have a look if possible.
Any help would be gr8 and any ideas from people which can give me any infos about it will be great!!!!!!!!!!!
Many thanks in Advance.
Pankaj -
Sorry if this is a repeat. I was interrupted and found that my browser had crashed when I came back so I'm not sure if the question got asked.
I need a script for a date field (mm/dd/yyyy) where the user can only fill in a date that is between 12/31/1899 and the current date (whatever the date when the form is opened). I'm getting better at writing these but I haven't been successful with this one. Any help would be greatly appreciated.
Thanks!I have a feeling I already answered this question some time ago... Anyway, you can use this code as the field's custom validation script:
var minDate = util.scand("mm/dd/yyyy", "12/31/1899");
var maxDate = new Date();
event.rc = true;
if (event.value) {
var d = util.scand("mm/dd/yyyy", event.value);
if (d<minDate || d>maxDate) {
app.alert("Error! The entered date must be between " + util.printd("mm/dd/yyyy", minDate) + " and " + util.printd("mm/dd/yyyy", maxDate));
event.rc = false;
Maybe you are looking for
-
Mail won't stop attempting to send message after 3 days
Greetings. My wife's iPhone 4 has been attempting to send a large message via Mail for the past 3 days. I'd like to stop the message since it's clearly not going to be sent. I've tried turning the phone off and on, but to no avail. The "Edit" box
-
JCo IDoc: SAP Business Connector required?
On my searching for the error IDOC_ERROR_METADATA_UNAVAILABLE i have found this thread: BC 4.7 -IDOC_ERROR_METADATA_UNAVAILABLE "As of SAP BC 4.7 the SAP Adapter (the piece dealing with the SAP system(s)) uses the new SAP IDoc Java API which uses oth
-
SP2013: Can a subsite owner block the site collection owner?
I read some discussion telling me Sharepoint allow subsite owner can block parent site owner. But in my test, the Site Collection owner ALWAYS have FULL PERMISSION on subsite. Is it true? I have tested in my farm. I login as one Site collection owner
-
When installing Adobe CS6 Master Collection, I'm getting an error the serial is unknown. I did use the serial before, but due to an installtion problem I have to reinstall Adobe. The serial has been registered on my own Adobe account, so I'm sure I'm
-
Pen Tool - Curve drawing under Object Lock
How do you draw a smoother curved line as described in this tutorial in Steps 6 and 7? http://design.tutsplus.com/articles/create-a-glowing-neon-sign-using-the-appearance-palett e--vector-3791