All records in a block of tabular data of several records in the shadow
I have a block of tabular data of several recordings and would like all the other records in the data block to have a shaded background color. How do I would accomplish this? (Excel worksheet attached that shows what I'm trying to do with a block of data Oracle Form)
I don't know how to control the background color of the current record, but this is NOT what I'm asking.
In the event where you fill your block using EXECUTE_QUERY you can do the following:
-Create a Visual attribute with the desired colors and name it VA_BACKGROUND
-Create a parameter named P_BANDING
-Put the following code in your PRE-QUERY-trigger:
:PARAMETER.P_BANDING:=1;
-Put the following code in your POST-QUERY-trigger)
IF :PARAMETER.P_BANDING=1 THEN DISPLAY_ITEM('YOUR_ITEM_NAME_HERE', 'VA_BACKGROUND'); END IF; :PARAMETER.P_BANDING:=1-:PARAMETER.P_BANDING;
Need DISPLAY_ITEM code once for each item that you want to color.
Tags: Oracle Development
Similar Questions
-
All records in the report need when I downloaded to Excel
Hello
for all my reports (Adhoc, canned), I need to display 25 records in the page, and if I download the results to excel I want that all the records in excellent.
I use the below configurations in my file.it instanceconfig works very well for the number of records for each page. But if I download the report, it's download only 25 records that are playing on this perticular page.
Someone tell how can I download all records in excellent with 25 records per page?
< Center >
< > 10020000 MaxCells < / MaxCells >
< MaxVisibleColumns > 30 < / MaxVisibleColumns >
< MaxVisiblePages > 1000 < / MaxVisiblePages >
< MaxVisibleRows > 64000 < / MaxVisibleRows >
< MaxVisibleSections > 25 < / MaxVisibleSections >
< DefaultRowsDisplayed > 25 < / DefaultRowsDisplayed >
< DefaultRowsDisplayedInDelivery > 75 < / DefaultRowsDisplayedInDelivery >
< defaultRowsDisplayedInDownload > 64000 < / DefaultRowsDisplayedInDownload >
< DisableAutoPreview > false < / DisableAutoPreview >
< / Center >
< table >
< > 10020000 MaxCells < / MaxCells >
< MaxVisiblePages > 1000 < / MaxVisiblePages >
< MaxVisibleRows > 64000 < / MaxVisibleRows >
< MaxVisibleSections > 25 < / MaxVisibleSections >
< DefaultRowsDisplayed > 25 < / DefaultRowsDisplayed >
< DefaultRowsDisplayedInDelivery > 75 < / DefaultRowsDisplayedInDelivery >
< defaultRowsDisplayedInDownload > 64000 < / DefaultRowsDisplayedInDownload >
< /table >
Published by: user12077461 on August 9, 2011 18:14He shud behave similarly... I mean all the files shud be downloaded. You can try this in any other envn? UAT or DEV?
I'm 100% sure that it shud download all...
-
Retrieve all records in the selected master child multi tables
Hello
I use JDeveloper 11.1.1.4 version and using ADF - BC in my project.
I have a one-to-one simple child master [several] in my project.
In my view page, I display this master child [Ex: EmpVo1-> DeptVo2] in the form of tables.
I have multi-selection enabled for the main table.
My requirement is that, on the multi by selecting the lines in the main tables, I want to get all the child records in my grain of support.
If a master has 3 child records line and another main line has 4 child records and on the selection of several of these two records in the primary table, I should get all the child records in my grain of support.
I need it to implement the cascade delete feature.
Here is the sample code coin
--------------------------------------------
(1) called on selecting rows in the master table
{} public void onRSCGrpSelect (SelectionEvent selectionEvent)
Add the code in the event here...
ADFUtil.invokeEL ("#{bindings.") RscGroupVO1.collectionModel.makeCurrent} «»
new class [] {SelectionEvent.class},
(New Object() {selectionEvent});
RowKeySet rowKeySet = (RowKeySet) tblRSCGrp.getSelectedRowKeys ();
CollectionModel cm = (CollectionModel) tblRSCGrp.getValue ();
for (object facesTreeRowKey: rowKeySet) {}
cm.setRowKey (facesTreeRowKey);
RowData = JUCtrlHierNodeBinding
(JUCtrlHierNodeBinding) cm.getRowData ();
Line = rowData.getRow ();
System.out.println ("\n" +)
row.getAttribute (0) + ":" + row.getAttribute (1) +.
(":" + row.getAttribute (2));
System.out.println ("display the child records");
displayChildRecords (row.getAttribute (0));
}
}
2 private void displayChildRecords (Object rscGrp) {}
ViewObject rscMapVo = getRscMapViewObj();
RowSetIterator rsI = rscMapVo.createRowSetIterator (null);
While (rsI.hasNext ()) {}
Line = rsI.next ();
System.out.println ("\n" +)
row.getAttribute (0) + ":" + row.getAttribute (1) +.
(":" + row.getAttribute (2));
}
rsI.closeRowSetIterator ();
}
But the problem is that he is always giving me the last selected lines child details.
Please suggest the error that I do.
Thank you
PraveenYour problem is to use makecurrent, which should not be used on a multi selection table. Then, if you have a relationship master detail you should have a view link between them. In this case, you can expose a method as you master to get the related child line. Not need to get the VO itself you can use the accessors of child iterator to obtain registration of the child.
public void onRSCGrpSelect(SelectionEvent selectionEvent) { // Add event code here... RowKeySet rowKeySet = (RowKeySet)tblRSCGrp.getSelectedRowKeys(); CollectionModel cm = (CollectionModel)tblRSCGrp.getValue(); for (Object facesTreeRowKey : rowKeySet) { cm.setRowKey(facesTreeRowKey); JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)cm.getRowData(); Row row = rowData.getRow(); //cast to the right row class EmpEmpVoRow empRow = (EmpEmpVoRow) row; // now you cann access the child row iterator RowSetIterator it = empRow.getDepVO(); //now you cna iterate over the child rows System.out.println("\n" + row.getAttribute(0) + " :: " + row.getAttribute(1) + " :: " + row.getAttribute(2)); System.out.println("Displaying Child Records"); //use hte child rows here } }
Don't know if the code compiles out of the box (do this on the train :-)
Timo
-
Stop the user to SELECT new registration of BLOCK of TABULAR DATA
Hello
I have a data tabular block has, that contains 10 records, by user mouse click can move any record of this data to another data block tabular Bblock.
In this case, I want to restrict the user, do not move a folder already moved, bulk data table B.
I tried several solutions but unable disable a moved file bulk data table A. The property AUTHORIZATION of INSERT or UPDATE ALLOWED the data block is not necessary (* as I don't have to change or insert values of the elements of text *) here. (I just disable the line moved block Atabular data. Is it possible, if so, then how? If no, any solution please.
I hope that I've illustrated the problem.
Kind regardsI could do it this way:
1)
create an attribute Visual to make it visible, the lines that have been moved, for example VA_BLACK_ON_GRAY (black letters on a gray background)2)
before moving the record so check Visual attribute is set.3)
If the attribute is set, do nothing. otherwise, go the other.example of a trigger:
BEGIN IF GET_ITEM_INSTANCE_PROPERTY('YOUR_BLOCK.YOUR_ITEM', CURRENT_RECORD, VISUAL_ATTRIBUTE) = 'VA_BLACK_ON_GREY' THEN MESSAGE('Record has already been moved!'); RAISE FORM_TRIGGER_FAILURE; END IF; -- --
-- SET_ITEM_INSTANCE_PROPERTY('YOUR_BLOCK.YOUR_ITEM', CURRENT_RECORD, VISUAL_ATTRIBUTE, 'VA_BLACK_ON_GREY'); END; Alternatively, you can set a hidden item (not database bound) to store the information, if the folder is moved...
-
I use Win 7 64 and recently all my files have begun to show read-only. Other responses on this forum, which suggests to change the read-only via the Properties dialog box, attrib command did not work. In addition, I created a new administrator account as suggested by another answer, but the problem persists on both accounts.
Several programs will not work now that they can not write files in folders.
What can I do to fix this?
Hello
See the following article for a description of this problem.
I hope this helps.
Thank you for using Windows 7
Ronnie Vernon MVP -
Show all records in the search results, please help
I have this before posting, but had no chance I used my script to search before but tried again and he's back ALL results of the DB... Can you see what I'm missing?
$var_SalaryReq_Recordset1 = '% ';
If (isset($_GET['SalaryReq'])) {}
$var_SalaryReq_Recordset1 = $_GET ['SalaryReq'];
}
$var_skills_offered_Recordset1 = '% ';
If (isset($_GET['skills_offered'])) {}
$var_skills_offered_Recordset1 = $_GET ['skills_offered'];
}
$var_location_Recordset1 = '% ';
If (isset($_GET['location'])) {}
$var_location_Recordset1 = $_GET ['location'];
}
$var_PositionReq_Recordset1 = '% ';
If (isset($_GET['PositionReg'])) {}
$var_PositionReq_Recordset1 = $_GET ['PositionReg'];
}
@mysql_select_db ($database_hostprop, $hostprop);
$query_Recordset1 = sprintf ("SELECT username, name, surname, SalaryReq, PositionReq, location, otherComments, skills_offered FROM think_signup WHERE SalaryReq LIKE %s or PositionReq AS location, AS GOLD skills_offered GOLD AS %s %s %s", GetSQLValueString ("%". ") $var_SalaryReq_Recordset1. '%', 'text'), GetSQLValueString ('%'. $var_PositionReq_Recordset1.) '%', 'text'), GetSQLValueString ('%'. $var_location_Recordset1.) ('%', 'text'), GetSQLValueString ('%'. $var_skills_offered_Recordset1, "text"));
$query_limit_Recordset1 = sprintf ("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query ($query_limit_Recordset1, $hostprop) or die (mysql_error ());
$row_Recordset1 = mysql_fetch_assoc ($Recordset1);
the search fields are
< input name = "PositionReq" type = "text" class = "textfeilds" value = "Job title" size = "32" / >
< input name = "skills_offered" type = "text" class = "textfeilds" value = "Required skills" size = "32" / >
< input name = "SalaryReq" type = "text" class = "textfeilds" value = "Salary offered" size = "32" / >
< input name = "location" type = "text" class = "textfeilds" value = "Location" size = "32" / >
Thanks in advance
Sorry, just need a push of foot. "%"
Thanks for the prompt.
concerning
-
To get all records using the CASE function
first_tbl
First_dt second_dt point
1 January 09 item1 1 July 09
April 1 09 item1 1 December 09
1 July 09 31 December 09 item1
December 15 09 10 May 10 item1
March 20, 12 10 August 12 item2
July 31, 12 15 December 12 item2
April 1 09 31 December 09 item2
second_tbl
Start_dt point end_dt flag
August 1 09 1 November 09 item1 null
2 November 09 1st December 09 item1 null
1 December 09 15 December 09 item1 null
December 15 09 31 December 09 item1 null
1 January 10 10 May 10 item2 null
10 May 10 December 31, 10 item2 null
1 January 12 March 15, 12 item2 null
March 20, 12 31 July 12 item2 null
I need o/p so that, if first_dt or second_dt between start_dt and end_dt, I need to make the flag as y (item is the common join) other wise 'n'.
I was able to make the flag go ' but not ' don't
Select A.first_Dt, A.second_Dt, B.Start_Dt, B.End_Dt, A.item, point.
Cases where B.falg is null
Then "n".
Else 'Y '.
End
Of firsttbl A, second_tbl B
Where
A.Item = B.Item
and
((A.first_Dt > =B.Start_Dt et A.first_Dt < = B.End_Dt))
Or
(A.second_Dt > =B.Start_Dt et A.second_Dt < = B.End_Dt)) ;
Please kindly help me to resolve this bug.
Thanks for your help in advance!select f.first_dt,f.second_dt,s.start_dt,s.end_dt, case when first_dt between start_dt and end_dt or second_dt between start_dt and end_dt then 'N' else 'Y' end flag from first_tbl f,second_tbl s where f.item = s.item
-
Divide the data into several lines in the table
Hello
I use apex of Oracle 10 g 3.2.
I have a requirement like this.
I have a table like TableA
Col1 Col2
90 1
91 1:2:3
92 3
I want the data as
Col1 Col2
90 1
91 1
91 2
91 3
92 3
How to do this?
Thank you
Published by: user13305573 on August 3, 2010 20:16with your_data as ( select 90 as col1, '1' as col2 from dual union all select 91, '1:2:3' from dual union all select 92, '3' from dual ) select y.col1, regexp_substr(y.col2, '[^:]+', 1, t1.column_value) as col2 from your_data y, 13 table(cast(multiset(select level from dual connect by level <= length (regexp_replace(y.col2, '[^:]+')) + 1) as sys.OdciNumberList)) t1 14 / COL1 COL2 ------------------ ----- 90 1 91 1 91 2 91 3 92 3 5 rows selected. Elapsed: 00:00:00.05 ME_XE?select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production 5 rows selected. Elapsed: 00:00:00.03 ME_XE?
-
Merge data from several rows in the output row
rollno
name City 1 - - - XYZ - - - Pune Suppose that it is a table of student and I want to output such as,
rollno name of city
------------------------------------
1 xyz Pune
How can I get it pls tell me.
Hello
Here's one way:
SELECT MIN (rollno) AS rollno
MIN (name) AS the name
MIN (City) AS city
The STUDENT
;
This assumes that each column will have (at most) only 1 entry not NULL.
If my assumption is wrong, then after a few examples of data (CREATE TABLE and INSERT statements) and the results desired from these data. Explain how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum: https://forums.oracle.com/message/9362002
-
Request covered all records using years as refrence
Hi all
My problem came as sequence of another thread, I've created here in the forum:
All the proposed solutions were very useful, but not perfect one.
Although I found a solution to this problem that doesn't involve creating a query, I came back with a similar situation with a need for the query. I'll try to better explain the issue.
I have my data like this sample
-DIS is a table with many distinct pairs of UC/PE_CODIGO.WITH dis AS (SELECT 1 AS COD, 'A' AS uc, 1977 AS initial_year, 2002 AS end_year, 10024 AS pe_codigo FROM DUAL), cred AS (SELECT 100 AS id, 'A' AS uc, 1982 AS initial_year, 1982 AS end_year, 2 AS credits, 10024 AS pe_codigo FROM DUAL UNION ALL SELECT 200 AS id, 'A' AS uc, 1986 AS initial_year, 1986 AS end_year, 7 AS credits, 10024 AS pe_codigo FROM DUAL UNION ALL SELECT 300 AS id, 'A' AS uc, 1988 AS initial_year, 1988 AS end_year, 4 AS credits, 10024 AS pe_codigo FROM DUAL UNION ALL SELECT 55 AS id, 'A' AS uc, 1989 AS initial_year, 1989 AS end_year, 3 AS credits, 10024 AS pe_codigo FROM DUAL UNION ALL SELECT 330 AS id, 'A' AS uc, 1990 AS initial_year, 1990 AS end_year, 4 AS credits, 10024 AS pe_codigo FROM DUAL UNION ALL SELECT 102 AS id, 'A' AS uc, 1991 AS initial_year, 1991 AS end_year, 6 AS credits, 10024 AS pe_codigo FROM DUAL)
-Table CRED have some additional data of each UC/PE_CODIGO. Each UC/PE_CODIGO may have one or more records with different INITIAL_YEAR and END_YEAR (and credits).
What I need?
-J' I need a query that returns all records, joining the two tables by PE_CODIGO and UC is, and covering the range of years that's on the table, SAY. In this example, I want to record from the year 1977 until 2002.
Using this rule (and this example) I want a record between 1997 and 1981, between 1982 and 1982, others from 1983 to 1985, from 1986 until 1986, and so on like this:
Notes:COD ID UC initial_year end_year credits pe_codigo 1 NULL A 1977 1981 NULL 10024 1 100 A 1982 1982 2 10024 1 NULL A 1983 1985 NULL 10024 1 200 A 1986 1986 7 10024 1 NULL A 1987 1987 NULL 10024 1 300 A 1988 1988 4 10024 1 55 A 1989 1989 3 10024 1 330 A 1990 1990 4 10024 1 102 A 1991 1991 6 10024 1 NULL A 1992 2002 NULL 10024
-TELL is considered to be a "pivot table". I only need chronogram SAY. Coming INITIAL_YEAR.
-END_YEAR (in both tables) can have a NULL value
-When I have no records in the table CRED with years between, the credits column must be a null (not NULL as String). And Yes ID column.
-One END_YEAR must have (not NULL as String) NULL values.
The best I can go it is with this query:SELECT a.cod, b.id, b.uc, b.initial_year, LEAST ( b.end_year, LEAD (b.initial_year) OVER (PARTITION BY b.uc ORDER BY b.initial_year) - 1) end_year, b.credits, a.pe_codigo FROM cred b, dis a WHERE a.uc = b.uc AND a.pe_codigo = b.pe_codigo (+) AND a.end_year >= b.initial_year
I have different scenarios in the CRED table. But I only need a query which can multiply records between SAY. INITIAL_YEAR and SAY. END_YEAR based in the information I have in the CRED table.COD ID UC initial_year end_year credits pe_codigo 1 100 A 1982 1982 2 10024 1 200 A 1986 1986 7 10024 1 300 A 1988 1988 4 10024 1 55 A 1989 1989 3 10024 1 330 A 1990 1990 4 10024 1 102 A 1991 6 10024
Sorry for the long explanation.
Can someone help me, please?
Thank you
Filipe Almeida
Published by: Filipe_Almeida on ago 10/2011 08:09Hi, Filipe,
The results you want with these new data sample even as the results that you have published with the latest data from the sample?
Filipe_Almeida wrote:
The line with COD = 2 is a different record that cod = 1. Have the same value of UC, but have a different PE_CODIGO. So it is another record.Yes, it's another record. This is exactly why I don't understand why you want to see cod = 1 in the output for the line where pe_codigo = 10000.
If you wish, you can put 'B' in the column of the CPU for recording with COD = 2...
You say there is a line in the output with the cod = 2? In the results of the sample you have validated, cod = 1 on all lines. Mayber, you need to verify that the results are accurate and post the correct results if they are not.
in tables DIS1 and DIS2 and ID = line 150 CRED table, as well.
Sorry, I'm dion can't understand this. In the examples of new data, is not uc = 'A' for all rows in all tables? Why is - it normal to have a CPU = "B" in the output?
END_YEAR = NULL means that, after INITIAL_YEAR, UC, this number of credits to infinity. For example (using DIS2), UC = 'A' with PE_CODIGO = 10024, in the year 2011 or the year 9999 is worthless credits. The same CPU, but in the year 1989 have 3 credits. But the year 1984 have no credit.
This END_YEAR cannot be NULL when we value END_YEAR DIS table for this specific/PE_CODIGO CPU. In this case the recordset must be completed this year.I see it; you want to treat a NULL end_year as impossibly high, all year effective at the latest. As my last request was written, it is only a matter then generate a fictitious line dated after the last row of the cred. I did it in the query below, by chaniging
df.end_year
TO
NVL (df.end_year, 9999)
in the last part of the UNION. Find the comment "CHANGED" very near the end.
WITH prev AS ( SELECT dp.cod , cp.id , dp.uc , 1 + LAG ( cp.end_year , 1 , dp.initial_year - 1 ) OVER ( PARTITION BY cp.uc , cp.pe_codigo ORDER BY cp.initial_year ) AS initial_year , cp.initial_year - 1 AS end_year , NULL AS credits , cp.pe_codigo FROM cred cp JOIN dis dp ON cp.pe_codigo = dp.pe_codigo AND cp.end_year >= dp.initial_year ) SELECT * FROM prev WHERE initial_year <= end_year -- UNION ALL -- SELECT dc.cod , cc.id, dc.uc , GREATEST ( cc.initial_year , dc.initial_year ) AS initial_year , NVL (cc.end_year, dc.end_year) AS end_year , cc.credits, cc.pe_codigo FROM cred cc JOIN dis dc ON cc.pe_codigo = dc.pe_codigo AND COALESCE ( cc.end_year , dc.end_year , dc.initial_year ) >= dc.initial_year -- UNION ALL -- SELECT df.cod , NULL AS id , df.uc , 1 + MAX (cf.end_year) AS initial_year , df.end_year , NULL AS credits , df.pe_codigo FROM cred cf JOIN dis df ON cf.pe_codigo = df.pe_codigo GROUP BY df.cod , df.uc , df.pe_codigo , df.end_year HAVING MAX (cf.end_year) < NVL ( df.end_year -- CHANGED , 9999 ) -- ORDER BY 7 -- pe_codigo , 4 -- initial_year ;
-
Hello world!
Im making a site with PHP and wonder if I can do this:
First: Let's say the db has 30 records in a table, and I want to change a particular data in all records. How can I do this?
Second: In the same how can way, I delete all the records in this table?
For example:
table 'example '.
collar ID, title, content, description
If I want to ' reset "(changer sa valeur à zéro, par exemple) 'description' value in all records in the table, how can I do this?".
And the second: How can I truncate the whole table? (TRUNCATE = empty all the data inside the table, right?)
All this PHP, phpmyadmin lol no!
Thanks in advance
See you soon!
As I said in the previous answer: use the UPDATE and DELETE MySQL commands. Look at em room for examples. There are a lot of examples out there that will do what you want. Basic examples are:
UPDATE table_name SET column_name = something, column_name_2 = sometingelse
or
DELETE FROM tbl_name where field = something.
-
CAN NOT MAKE RECORDS OR CHANGE THE NAMES OF FILE 0N ALL RECORDS
CAN NOT DO ALL RECORDS IN THE ACCOUNTS - CAN NOT DO ANY CORRECTION ON FOLDERS-PRESS FOIDER ICON BUT NO ACTION OR HOW TO CHANGE THE NAME OR INFORMATION ABOUT THE FILES
What happened a bit in the past, but we see a lot more often recently. Here are two options.
How to remove and restore the default context Menu items 'New' in Windows 7 and Windows 8
http://www.SevenForums.com/tutorials/28677-new-context-menu-remove-restore-default-menu-items.html
If still no joy, see the 'response' by Linda Yan in this thread.
http://social.technet.Microsoft.com/forums/en-us/w7itprogeneral/thread/97de8a2a-12f2-4381-A409-a78f4ae551cf/#99395761-56de-4a76-8C2A-eab498ad735a
Tip: When you save the text in Notepad, the default file format is .txt. Replace all files.
-
All records of the library of Lr see all of the photos but when I click on a folder I get 'no photo selected. I import all of my photos and all is well for a short period then the images seem to disappear again. This happens in most cases, but not all. Any help please?
Hi colini,.
Suggest you to reset preferences in Lightroom and then, check out: given to zero (or "Trashing") the Lightroom preference file. Lightroom Forums
Kind regards
Claes
-
Retriving all records in table
Hello
To retrieve all records from the table, procedure below has been used, but the performance gets only a single record in the output.
Procedure (proc_env) has been wrapped into the package (packg)
This package gets the call from the java environment to extract all records in the table.
Procedure wrapped in packaging
--------------------------------------------------
PROCEDURE proc_test (cursor1 OUT TestCursor)
IS
BEGIN
OPEN FOR Cursor1
SELECT col1,
col2,
COL3
Table_name FROM
END;
procedure called for execution
-----------------------------------------
DECLARE
v_col1 table.col_name%TYPE;
v_col2 table.col_name%TYPE;
v_col3 table.col_name%TYPE;
v_cur packg. TestCursor;
BEGIN
packg.proc_test (v_cur);
EXTRACT the v_cur IN v_col1, v_col2, v_col3;
DBMS_OUTPUT. ENABLE;
Dbms_output.put_line (v_col1 |) ',' || v_col2 | «, » || v_col3);
END;
/
How to retrieve all the records in the table?
What is missing in the code?
RegardingSET SERVEROUTPUT ON DECLARE v_col1 table.col_name%TYPE; v_col2 table.col_name%TYPE; v_col3 table.col_name%TYPE; v_cur packg.TestCursor; BEGIN DBMS_OUTPUT.ENABLE; packg.proc_test(v_cur); LOOP FETCH v_cur INTO v_col1,v_col2,v_col3; EXIT WHEN v_cur%NOTFOUND; DBMS_OUTPUT.put_line(v_col1||','||v_col2||','||v_col3); END LOOP; CLOSE v_cur; END; /
SY.
-
Help for a date and time string in the format of get-date
When you take a date / time string of an object:
The format of the entry is a string and get-date doesn't seem to be able to convert to the
a System.DateTime.
I want to compare this value to 30 days so there are get-date ((get-date).adddays(-30))
When I try the following, it seems to work then import it:
(get-date - UFormat "%d/%m/%Y %T" ("2010-06-30 00:00:00" ""))
If I add the following:
"[datetime]" (get-date - UFormat "%d/%m/%Y %T" ("2010-06-30 00:00:00" ""))
He can't convert it.
Without the datetime component, when I try a superior test uses only the date
the part as well:
$Test = '2009-10-06 00:00:00.
If ($Test - gt (get-date - UFormat "%T"("06/05/2010 00:00:00") %d/%m/%Y ""))
{
$Tested = 'Yes '.
}
On the other
{
$Tested = 'no '.
}
$tested
Results in a Yes tentatives being earlier.
In the script it returns all records where the date is after
as 05 and ignore the year, month, and time.
Any help with this would be greatly appreciated.
Thank you
This has to do with the 'culture' that you use in your PowerShell session.
You can use the Get-Culture cmdlet to see that one you use.
If you try
[datetime](get-date -UFormat "%m/%d/%Y %T"("30/06/2010 00:00:00"))
The parameter - UFormat produces a string and
the cast is expected default mm/dd/yyyy format, for the part of the date.
So, by reversing the month and day of your UFormat string - that has been corrected.
BTW, I have attached the line because the SW forum do not have hooks.
____________
Blog: LucD notes
Twitter: lucd22
Maybe you are looking for
-
Attach the photo file to an e-mail message
Adding a photo to an email. At present, I wonder to open the file, but the individual images are not transferred then.
-
IO use the Mail app. MI living often che dopo avere delle e-mail, the avatar.3D.DVDSCR.XviD received e poi out the application. Quando riapro app, pero, are ricaricate Como no lette, anche che avevo letto/eliminato precedentemente e-mail. E una cosa
-
Searching for drivers Win 7 for Satellite L40 ASMBNX1
Hello. I got a new Toshiba Satellite L40 ASMBNX1 as a gift from my brother. It has been pre-installed with Windows 8. I can't wait to win 8 and formatted the HARD drive.Installed Windows 7 but now looking right and compatible drivers. I found another
-
Value problem of features for the INF with the winpk filter installation.
Hello I use an inf to my driver installation using properties of LAN, but I am facing the following problems during the installation of my driver with the installation of the winpk filter: All these changes are made with windows 2008 R2 64-bit Server
-
I find the minidump files and tried opening them and could not. Files and downloaded programs of debugging appear in the program. When I try to open them I get "you must be an administrator to open" insofar as I know that I am the administrator becau