The joins of data and help to Pivot
Hi, I have a fact table and a table of huge story that will really with partitions stored with dates of end of month.I am looking for a way to manipulate the month and year of DateChanged to table the long interview with seal on the acct recover scores of the month previous, resulting in a format of standardized data such as in the result table.
Any ideas? Thank you!
Table A
Acct DateChanged
-----------------------------------
123 1/12/2008
456 8/25/2008
Table B:
Acct DateUpload Score
-----------------------------------------
123 11/30/2007 620
123 12/31/2007 650
123 01/31/2008 712
123 02/29/2008 800
456 05/31/2008 520
456 06/30/2008 630
456 07/31/2008 680
456 08/31/2008 710
456 09/30/2008 780
456 10/31/2008 786
456 11/30/2008 823
Result Table:
Acct Score2MonthPrior Score1MonthPrior
-------------------------------------------------------
123 620 650
456 630 680
Hello
Whenever you have any questions, post a small example of data in a form, in fact, people can use. CREATE TABLE and INSERT statements are the best. A clause WITH, like Solomon posted, is better than nothing. Without it, people will help you as much as they can, but do not expect to test anything.
Using data of Solomon, I was able to test (and correct) my request.
WITH got_priormonth AS
(
SELECT a.acct
, b.score
, MONTHS_BETWEEN ( TRUNC (b.date_upload, 'MONTH')
, TRUNC (a.date_changed, 'MONTH')
) AS priormonth -- Alias added
FROM tableA a
JOIN tableB b ON a.acct = b.acct
WHERE a.date_changed >= ADD_MONTHS ( TRUNC (b.date_upload, 'MONTH')
, -2
)
AND a.date_changed < TRUNC (b.date_upload, 'MONTH')
)
SELECT acct
, MAX (CASE WHEN priormonth = 2 THEN score ELSE 0 END) AS score2monthprior
, MAX (CASE WHEN priormonth = 1 THEN score ELSE 0 END) AS score1monthprior
FROM got_priormonth
GROUP BY acct
;
ORA-00907 actually means "absolutely free index to the subject of what you hear".
Perhaps a missing closing parenthesis causes the error as much as anything, but when you get this error, look for any type of syntax error at (or just before) the specified point.
You're right, I forgot the column alias. Sorry; If I could have it tested before posting, I would have.
Tags: Database
Similar Questions
-
In Muse miniature slideshow container, I have images where I can insert the data of image properties. SEO search engines see the data and help the visibility of my site?
Post edited by: Howard Lower and rewrote the question because I have yet to get a response.
Yes, they will be included in the report.
Please check these links:
https://helpx.Adobe.com/Muse/how-to/add-alt-text-and-ToolTips.html
https://forums.Adobe.com/thread/1747973?start=0&TSTART=0
Thank you
Sanjit
-
Is function like the function of date and time picker in the ICB 8.5?
I need the function as "date and time picker control" used in activeX, but my operating system (windows 7 Bits without office software) is not the «Microsoft date controller» and time picker I am looking article in the internet which mention this register the MSComctl2.ocx in the windows\system32, but he could not operator in my operating system (it's not allow to save the controller). Help me, please.
Already, I discovered that the problem on the service of DTP in the 64-bit Windows 7 could not used. Because, the DTP is 32 bits, it should use the administrator to register the 'mscomct2.ocx file' which must be replace in the % windows/SysWOW64 and used the 'mscomct2.ocx regsvr32.exe"in console windows.
-
Do the photo album, date and time taken?
Just downloaded all my iPhotos to Photos from the old to the new iMac. All the old photos transferred with the intact title (date and time). How to activate this in Photos? Added some new pictures for the first time to Photos and may not know how to make the title the date and time the photo was taken (without manually typing in the date and time).
That s not a feature of Photos
Users contributed scripts to perform these tasks - Script: batch changing the title to the Date of Capture -or http://www.oldtoadstutorials.net/No.P01.html
LN
-
How can I get rid of the file name, date and size of the photo in the upper left corner of the module develop when I'm not working on the photos?
All shortcuts are listed on the view > menu Info Magnifier.
-
Include the expected start Date and end Date for the management of SSHRC-Absence
Is it possible to include the scheduled Start Date and end Date of project to SSHRC, management of absences with the type of leave is confirmed?
Thanks in advanceHello
In this case, you should disable the option the absence request, so that by default all sheets are confirmed and the user do not have to apply once leave as planned and then comply.
You can see the id metalink - "How do I disable the State of Absence of R12 Absence Management Page [ID 786691.1]" to understand how to disable "Planned" option to request authorization for simple customization.
It will be useful.
Thank you
Sanjay -
Use the project start Date and duration to calculate the end Date of project
I'm trying to calculate the end date of the project in a report using the project end Date and time entered on the opportunity.
For example, if the start date of the project filled an opportunity is 31/01/2009 and the length (integer) is entered on the opportunity is 5, the project end date is in the report must be 30/06/2009.
I'm trying to TIMESTAMPADD forumaul allows you to add the duration (number of months) to the project start date
This Fx works TIMESTAMPADD (SQL_TSI_MONTH, 12, '-used Custom Attributes ".) DATE_40)
But if I try to replace the number twelve by the length (integer field) I get an error when you try to save: TIMESTAMPADD (SQL_TSI_MONTH, "-opportunity Custom Metrics".) S_INT_0, '-used custom attributes. DATE_40)
Any ideas on how I can get this to work would be greatly appreciated.Hi, try this. It might solve your prioblem TIMESTAMPADD (SQL_TSI_MONTH, CAST (YOUR FIELD AS INTEGER), account. (' "Last modified")
-John CRMIT
-
Hi all... I learn LabVIEW since few days.i want to acquire a signal of pc6251 of acquisition of data and perform fft it can u people please help me? Thanks in advance
If you do only use LabVIEW for a few days, you should get familiar with it first by looking at some of the resources available here. After that, you can watch heredata acquisition.
After reviewing these documents, you can post back with any specific questions.
-
Help in the merging of data and create mailing labels
I have a CSV file with three field ("name, envelope" "" = address"and"City ST Zip") and 245 records.
I have the labels that correspond to seven on a page.
I have the designed document. I am able to get the fields inserted, but... when I merge, I get the first page with seven the first record labels, the second page with seven second record labels, page 3 with seven third record labels. You get the photos. I want seven different addresses on each page. So... instead of having more to 35 245 pages.
Is this possible or should I find a way to make my drawing in Word? * sigh *.
Everyone made the same mistake; you set seven (records) to your InDesign document, are not.
Create the first instance (upper-left)
Go to control panel to merge the data and choose multiple records per page.
It helps to have put guidelines in place for the Visual presentation and I try to keep the total area of my equal fields the number of hole - exactly 2 inches of width, for example.
Data merge multiple records per page will need the values for spacing from room to room. Integers and guides make easier.
-
AppleScript set the string to date and add 30 minutes
I am filling 2 boxes of time on a website in Safari, using Applescript from buttons selected by the user.
My current Applescript is:
Value dialog box to display the dialog box buttons ' when did your first departure case? {"07:30, ' 08:00, ' 08:30" "" "}
definition of the first button returned of the result
inputByName ("time 1", 0, start)
the value of test for '07:30 ' - assuming that the user has selected '07:30 ' in the dialog box
Test date - do not know how to assign 07:30 as an hour
Finishing to test set + (30 * minutes)
inputByName ("2", 0, finishing)
The error return is number 'Invalid date and time date 07:30 < < script > >.' -30720
Any help would be greatly appreciated!
Thank you
s
You must use a complete date in the date/time of your machine settings. A simple way is to simply get the current date (which returns a full date object) and manipulate that, for example:
tell (current date) set its time to (7 * hours) + (30 * minutes) set someDate to it end tell return time string of someDate
-
How to compare a Date with the current year data and member of period on FIX
Hi experts,
I have a Sun project that each Member is a project (P01, P02,...)
and account IMGs who stores the information of each project (name, Start date, finished...)
Finished Date member is of data type Date
So how can write an IF condition below in order to be able to compare the end Date of the project with the members of the current year and period on FIX
DIFFICULTY (@Descendants (Projects), Descendants (year-round), Descendants ("year Total")...)
IF (@CURRMBR (Period)-> @CURRMBR (Year) < Project > - FinishedDate)
Do something...
On the other
Do something
Please help me on this. Sorry for my bad grammar. Please ask if there is something not clear
Thank you very much
Van Huy.
Published by: Van Huy on 29 January 2013 01:14
Published by: Van Huy on 29 January 2013 02:24
Published by: Van Huy on 29 January 2013 02:25
Published by: Van Huy on 29 January 2013 18:04Here's what I did. Post for which may later cover
VAR FM; / * End of month of the project.
VAR EXERCISE; / * Year of the project terminated * /.
VAR CM; / * Capture the current month on FIX declarations * /.
VAR CY; / * Capture current year on FIX declarations * /.DIFFICULTY (@RELATIVE ('year', 0), @RELATIVE ('period', 0), @IDescendants ("core projects")...)
FY = @ROUND ('TGHT'-> ' NA contract "-> 'FY06'-> ' NA period" / 10000, 0);
FM = @MOD (@ROUND ('TGHT'-> ' NA contract "-> 'FY06'-> ' NA period" / 100, 0), 100);
/ * For FY13 back 13... */
CY = @JgetDoubleFromString (@CONCATENATE ('20', @SUBSTRING (@NAME (@CURRMBRRANGE (year, Lev, 0, 0, 0)), 2)));
/ * Value CM set based on perceived period on the DIFFICULTY of statement * /.
IF (@ISMBR ("Jan"))
CM = 1;
ELSE IF (@ISMBR ("February"))
CM = 2;
.....
ELSE IF (@ISMBR ("Dec"))
CM = 12;
ENDIFIF (CY< fy="" or="" (="" cy="=" fy="" and="" cm=""><>
Do something...
ON THE OTHER
Do something...
ENDIF
ENDFIXPublished by: Van Huy on 19 February 2013 23:10
Published by: Van Huy on February 20, 2013 19:46
-
The JavaScript calendar date and access date incompatible field!
I need some help here! My form has two fields where the user enters a beginning date and an end date. These dates are then used in a WHERE clause to retrieve all records in these dates. The problem is that access does not recognize dates and shows not all records. If I remove the WHERE clause, all records are displayed. I tried to change the area of access to the text, use the input mask, etc. nothing works. Any ideas?
This is the code for the entry form;
< html >
< head >< style type = "text/css" >
{.ds_box}
background-color: #FFF;
border: 1px solid #000;
position: absolute;
z index: 32767;
}{.ds_tbl}
background-color: #FFF;
}{.ds_head}
background-color: #333;
color: #FFF;
do-family: Arial, Helvetica, without serif.
font size: 13px;
make-weight: bold;
text-align: center;
letter-spacing: 2px;
}{.ds_subhead}
background-color: #CCC;
Color: #000;
do-size: 12px;
make-weight: bold;
text-align: center;
do-family: Arial, Helvetica, without serif.
Width: 32px;
}{.ds_cell}
background-color: #EEE;
Color: #000;
font size: 13px;
text-align: center;
do-family: Arial, Helvetica, without serif.
padding: 5px;
cursor: pointer;
}{.ds_cell:hover}
background-color: #F3F3F3;
} / * This code hover does not work for IE * /.< / style >
< style type = "text/css" >
<!--
. Style8 {do-family: Tahoma}
->
< / style >< style type = "text/css" >
<!--
{body
background-image: url();
background-repeat: no-repeat;
left margin: 0px;
margin-top: 0px;
}
a: link {}
text-decoration: none;
}
a: visited {}
text-decoration: none;
}
a: hover {}
text-decoration: none;
}
a: active {}
text-decoration: none;
}
. Style9 {make-size: 12px}
.style10 {do-size: 14px}
.style11 {do-size: 16px}
{.style12}
do-size: 18px;
make-weight: bold;
}
->
< / style >
< / head >< title > manna Prime - Kit < /title > Report
< body >
< table class = "ds_box" cellpadding = "0" cellspacing = "0" id = "ds_conclass" style = "" display: none; ">"
< tr > < id td = "ds_calclass" >
< table > < /tr >
< /table >< script type = "text/javascript" >
<!-<! [CDATA]Project: Date Picker Dynamics (DtTvB) - 2006-03-16
The script featured on JavaScript Kit - http://www.javascriptkit.com
Code to start...
Set the initial date.
var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth () + 1;
ds_c_year = ds_i_date.getFullYear ();Get the item by Id
function ds_getel (id) {}
return document.getElementById (id);
}Download the left and the top of the element.
function ds_getleft (el) {}
var tmp = el.offsetLeft;
El = el.offsetParent
{while (El)}
tmp += el.offsetLeft;
El = el.offsetParent;
}
return tmp;
}
function ds_gettop (el) {}
var tmp = el.offsetTop;
El = el.offsetParent
{while (El)}
tmp += el.offsetTop;
El = el.offsetParent;
}
return tmp;
}Output element
var ds_oe = ds_getel ('ds_calclass');
Container
var ds_ce = ds_getel ('ds_conclass');Output control
var ds_ob = ";
function ds_ob_clean() {}
ds_ob = ";
}
function ds_ob_flush() {}
ds_oe.innerHTML = ds_ob;
ds_ob_clean();
}
function ds_echo (t) {}
ds_ob += t;
}var ds_element; Text element...
var ds_monthnames =]
'January', 'February', 'March', 'April', 'May', 'June ',.
'July', 'August', 'September', 'October', 'November', 'December '.
]; You can translate it into your language.var ds_daynames =]
'Sun', 'Mon', 'Mar', 'Sea', 'Thursday', 'Sun', 'Sam '.
]; You can translate it into your language.Model calendar
function ds_template_main_above (t) {}
"return ' < table cellpadding = '3' cellspacing ="1"class ="ds_tbl">"
+ "< tr >".
+ ' < class td = "ds_head" style = "" cursor: pointer "onclick =" ds_py (); "> & lt; & lt; < table > '
+ ' < class td = "ds_head" style = "" cursor: pointer "onclick =" ds_pm (); "> & lt; < table > '
+ ' < class td = "ds_head" style = "" cursor: pointer "onclick =" ds_hi (); ' colspan = "3" > [close] < table > '
+ ' < class td = "ds_head" style = "" cursor: pointer "onclick =" ds_nm (); "> & gt; < table > '
+ ' < class td = "ds_head" style = "" cursor: pointer "onclick =" ds_ny (); "> & gt; & gt; < table > '
+ "< /tr >".
+ "< tr >".
+ '< td colspan = "7" class = "ds_head" >' t + '< table >.
+ "< /tr >".
+ "< tr >";
}function ds_template_day_row (t) {}
return '< class td "ds_subhead" = >' t + '< table > ";
Set the width in CSS, XHTML Strict 1.0 does not have the width for her property.
}function ds_template_new_week() {}
return '< /tr > < tr > ";
}function ds_template_blank_cell (colspan) {}
return ' < td colspan = "' + colspan + '" > < table > '
}function ds_template_day (d, m, y) {}
return ' < class td = "ds_cell" onclick = "ds_onclick (d + ',' + m + ',' + y + ')" > ' d + '< table > ";
Set the width of the line of the day.
}function ds_template_main_below() {}
return '< /tr > ".
+ '< /table > ';
}It is inspired by calendar...
function ds_draw_calendar (m, y) {}
Start by removing the output buffer.
ds_ob_clean();
Here, we will make the header
ds_echo (ds_template_main_above (ds_monthnames [m - 1] + ' ' + y));
for (i = 0; I < 7; i ++) {}
ds_echo (ds_template_day_row (ds_daynames [i]));
}
Make a date object.
var ds_dc_date = new Date();
ds_dc_date.setMonth (m - 1);
ds_dc_date.setFullYear (y);
ds_dc_date. SetDate (1);
If (m == 1 | m == 3 | m == 5: m == 7 | m == 8 | m == 10: m == 12) {}
days = 31;
} Else if (m == 4: m == 6 | m == 9 | m == 11) {}
days = 30;
} else {}
days = (y % 4 == 0)? 29: 28;
}
var first_day = ds_dc_date.getDay ();
var first_loop = 1;
Beginning of the first week
ds_echo (ds_template_new_week());
If Sunday is not the first day of the month, make an empty cell...
If (first_day! = 0) {}
ds_echo (ds_template_blank_cell (first_day));
}
var j = first_day;
for (i = 0; I < days; i ++) {}
Today is Sunday, a new week.
If this Sunday is the first day of the month,
We already have a new line for you.
If (j == 0 & &! first_loop) {}
New week!
ds_echo (ds_template_new_week());
}
Do a rank of this day here!
ds_echo (ds_template_day (i + 1, m, y));
Is not first loop more...
first_loop = 0;
What is the next day?
j ++;
j % = 7;
}
Make the footer
ds_echo (ds_template_main_below());
And we will show...
ds_ob_flush();
To scroll in the display.
ds_ce. ScrollIntoView();
}Function to display the calendar.
When the user clicks on the date, it will define the content of t.
function ds_sh (t) {}
Set the element to set.
ds_element = t;
Make a new date and set the current month and year.
var ds_sh_date = new Date();
ds_c_month = ds_sh_date.getMonth () + 1;
ds_c_year = ds_sh_date.getFullYear ();
Draw schedule
ds_draw_calendar (ds_c_month, ds_c_year);
To change the position correctly, we must show first.
ds_ce.style.display = ";
Move the calendar container!
the_left = ds_getleft (t);
the_top = ds_gettop (t) + t.offsetHeight;
ds_ce.style.left = the_left + 'px ';
ds_ce.style.top = the_top + 'px ';
To scroll in the display.
ds_ce. ScrollIntoView();
}Hide the calendar.
function ds_hi() {}
ds_ce.style.display = 'none ';
}Moves to next month...
function ds_nm() {}
Increase the current month.
ds_c_month ++;
We have past December, back to next year.
Increase the current year and set the month of January.
If {(ds_c_month > 12)
ds_c_month = 1;
ds_c_year ++;
}
Redraw the calendar.
ds_draw_calendar (ds_c_month, ds_c_year);
}Moves to the previous month.
function ds_pm() {}
ds_c_month = ds_c_month - 1; Impossible to use the dashboard dashboard here, getting the invalid page.
We stayed in January, let's go back to the previous year.
Decrease the current year and set the month of December.
If (ds_c_month < 1) {}
ds_c_month = 12;
ds_c_year = ds_c_year - 1; Impossible to use the dashboard dashboard here, getting the invalid page.
}
Redraw the calendar.
ds_draw_calendar (ds_c_month, ds_c_year);
}Moves to next year...
function ds_ny() {}
Increase in the current year.
ds_c_year ++;
Redraw the calendar.
ds_draw_calendar (ds_c_month, ds_c_year);
}Moves to the previous year...
function ds_py() {}
Reduction in the current year.
ds_c_year = ds_c_year - 1; Impossible to use the dashboard dashboard here, getting the invalid page.
Redraw the calendar.
ds_draw_calendar (ds_c_month, ds_c_year);
}The format of the release date.
function ds_format_date (d, m, y) {}
2-digit month.
M2 = '00' + m;
M2 = m2.substr (m2.length - 2);
day 2-digit.
D2 = '00' + d;
D2 = d2.substr (d2.length - 2);
AAAA-MM-JJ
return m2 + "/" + d2 + "/" + y;
}When the user clicks on the day.
function ds_onclick (d, m, y) {}
Hide the calendar.
ds_hi();
Set the value of it, if we can.
If (typeof (ds_element.value)! = 'undefined') {}
ds_element. Value = ds_format_date (d, m, y);
Maybe we want to define the HTML in there.
} else if (typeof (ds_element.innerHTML)! = 'undefined') {}
ds_element.innerHTML = ds_format_date (d, m, y);
I don't know how we should view, only he warn the user.
} else {}
Alert (ds_format_date (d, m, y));
}
}And this is the end.
[]] >-->
< /script >< are method = "post" action = "kit_report2.cfm" >
< class p = 'style8 style12' > Kit Report < /p >
< class p = "style8 style11" > report date span < /p >
< p > < span class = 'style8 style11' > start date:
< label >
< Input onClick = "ds_sh (this); "name = 'Start' readonly ="readonly"value =" "style =" "cursor: text" / > ""
< / label >
End date:
< label >
< Input onClick = "ds_sh (this); "name = 'End' readonly ="readonly"value =" "style =" "cursor: text" / > ""
< / label >
</span > < span class = "style8 style10" > < label > < / label >
</span > < span class = "style8 style9" > < label > < / label >
</span > < span class = "style8" > < label > < / label >
</span >
< label > < / label >
< /p >
< p >
< label >
< name of entry = "Submit" type = "submit" id = "Submit" value = "Run report" >
< / label >
< /p > < / make >
< / body >
< / html >This is the query that is used on the page of action;
< cfquery datasource = "manna_premier" name = "kit_report" >
SELECT SaleDate,
TerritoryManager,
Distributor,
DealerID,
Variable
Orders
WHERE SaleDate BETWEEN #FORM. Start # AND #FORM. End #.
ORDER BY SaleDate
< / cfquery >... The problem is that access does not like
dates and not all records will display.
...
WHERE SaleDate BETWEEN #FORM. Start # AND #FORM. End #.
Use one of the available functions to convert the form field values in a date object. Learn more about the CreateODBCDate function
WHERE DateColumn BETWEEN #CreateODBCDate (form.start) #...
and the CFQueryParam tag
WHERE DateColumn BETWEEN
....
I tried to change the access to the text field
No, do not use 'text' to store dates. Dates should always be kept as DateTime.
-
How to insert the last updated date and user id to a form?
Hello
I created a form to enter data into a custom table.
When a new record is created, I want to keep track of the date created, last updated date, and who (user id) enters the form.
Can you please help or point me to a good place to look for this information?
Thank you!
LCCreate four new columns in your table called Created_On, Created_By, Last_Updated_On and Last_Updated_By.
You can create a trigger for the rest:
create or replace trigger "
" before insert or update on " " for each row begin if inserting then :NEW.Created_On := sysdate; :NEW.Created_By := v('APP_USER'); end if; if updating then :NEW.Last_Updated_On := sysdate; :NEW.Last_Updated_By := v('APP_USER'); end if; end; Whenever you will add or modify data in this table, the trigger will automatically fill these fields.
Kind regards
Mathieu -
Copy the table with data and constraints
Hi all
I need to create a stored procedure that creates a table and copy a table with its data and constraints. We use it for backups. Y at - it all stored procedures out there who can do it, im pretty new to this and I need to create a stored procedure that can achieve this.
any help will be much appreciated
Thank you
KHello
The procedure that you created is invalid
Recompile it, and then type
show error
Rectivy the error until the procedure becomes valid.
Concerning
Anurag -
Evil of the formats of date and currency in the Sierra
I'm on MacOS in English, but I want the region settings to reflect the country I live in.
After the passage of El Capitan in Sierra, date and currency formats broke. For example, if you set the region of Finland, the date format should be 26.9.2016 instead of 26/09/2016. Also the currency symbol must appear after the value, 4 €567,89 instead of €4 567,89.
Days of week and months are untranslated.
Have you checked the tab 'Advanced' for date and time formats?
Just after the upgrade, I found that the short format for the date has been reset to include slashes, whereas I had previously removed them.
My region is set to the Germany, but with the main system language set to English, the months and days of the week are in English. I can't find a way to change this.
Maybe you are looking for
-
Once a year, we build a loop to show out of our images. I use the same camera, go pro, same computer, same fcp, BUT this year it won't let me add the pro images go on my calendar to my G-Drive. I tried to convert it and even if it works... it is ver
-
Could not open the photos restored from a backup
I can't open the photos restored from an external hard drive. Error message says I don't have permission to do so. I have check everything that I can think of and I am also the administrator of the computer. Can anyone help? I spent at least eigh
-
Printing from IPad or Iphone always goes to Tray 1, but tiroir2 is the default tray.
Product name: OfficeJet 8500 has more Op systems: Win 7 & Apple Ipad and Iphone and MAC Error messages: no Changes: has never been worked, no change I have two bins in my printer. Tray 1 is used for envelopes and tray 2 is the standard letter paper.
-
printer goes offline without reason
Product - HP photosmart 2610 all-in-one Wisdows Vista 64-bit Printing error in the queue Default printer listed as offline and can't do online.
-
I tried almost every answer nothing is done online. Both my Canon T1i and my Nexus 7 Tablet does not connect to my office. Raise them the same error message: device driver has not been installed with success, usually with the error "code 31". My lapt