How do I select a date column and display the millesecond along with it.
I am trying to select a date column from database and want to
display millesecond with it. How do I do this. I am aware of
the "alter session set NLS_DATE_FORMAT = 'MM/DD/YY HH:MI:SS'"
command. However, I do not know how to display this with the
millesecond.
Thanks for all the help.
Example:
SQL> CREATE OR REPLACE JAVA SOURCE
2 NAMED "MyTimestamp"
3 AS
4 import java.lang.String;
5 import java.sql.Timestamp;
6
7 public class MyTimestamp
8 {
9 public static String getTimestamp()
10 {
11 return (new
12 Timestamp(System.currentTimeMillis())).toString();
13 }
14 };
15 /
Java created.
SQL> CREATE OR REPLACE FUNCTION my_timestamp
2 RETURN VARCHAR2
3 AS LANGUAGE JAVA
4 NAME 'MyTimestamp.getTimestamp() return java.lang.String';
5 /
Function created.
SQL> CREATE TABLE test_time
2 (date_col VARCHAR2 (23))
3 /
Table created.
SQL> INSERT INTO test_time (date_col)
2 SELECT my_timestamp
3 FROM dual
4 /
1 row created.
SQL> SELECT date_col
2 FROM test_time
3 /
DATE_COL
2001-11-02 14:58:51.766
Similar Messages
-
How can I remove u0091*u0092 s and display the amount
My coding
T1 TOTAL,,,,,,®UD-SWABZ& ®UD-SWNES&
Doubt :
REGUD-SWNES is the value coming from structure REGUD,
But the value is coming as **********70.250,92
But I need to display as 70.250,92
How can I remove * s and display the amount ?Not sure why it is coming like that. Is the field length big enough?
I guess, you could try....
translate REGUD-SWNES using '* '.
condense REGUD-SWNES no-gaps.
But again, I have no clue as to why you are seeing this.
Regards,
Rich Heilman -
How to display the message along with a value using BBP_CHECK_BADI
Hi Gurus,
I need to display a message dynamically when the user create's a shopping cart. I am using Check_badi for this. i.e., I need to display the buyer number and amount left for him dynamically. I am storing both of them in variables and don't know how to display the messages laong with some message " the amount left for <XXXXXX> is <$$$$$$$$>". Can you help me out.
Thanks,
NeelimaHi,
you can use the function module 'BBP_PD_MSG_ADD'. This is the function module normally used for the displaying the error messages in SRM.
See wether you can use already available error messages , use the transaction SE91 , and the message class being BBP_PD -
How to wrap text in two columns and display as one in WAD
Hi ,
I have the following columns in my ODS , they are not KF's
c1 c2 c3
100 AA BB
200 CC DD
I need this display format
100 AA
BB
200 CC
DD
I need to wrap the text in columns c2 and c3 and display them under one column.
Is it possible in webtemplate by using java scripting.IN the Query , you could diplay Characteristics as a Hierarchy. Just above the Columns Box in Bex, do a write click.
Hope this helps -
How to get value in previous column and another row from Matrix with Custom Code?
I want to calculate the value of tb_Open and tb_Close. I try to use custom code for calculate them. tb_close is correct but tb_Open is not correct that show value = 0 .
This is example report:
* I have 2 Dataset , Dataset1 is all data for show in my report. Dataset2 is only first Open for first month
* First value of Open is item field in Dataset2 and this value only for first month (january). But for other month Open value get from Close in previous month.
Detail for Red number:
1. tb_Open -> tb_Close in previous month but first month from item field in Dataset2
expression =FormatNumber(Code.GetOpening(Fields!month.Value,First(Fields!open.Value, "Dataset2")))
2. tb_TOTAL1 group on item_part = 1
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)))
3. tb_TOTAL2 group on item_part = 3 or item_part = 4
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) + ReportItems!tb_TOTAL1.Value )
4. tb_TOTAL3 group on item_part = 2
expression =FormatNumber(Sum(CDbl(Fields!budget.Value)) - ReportItems!tb_TOTAL2 .Value)
5. tb_Close -> calculate from tb_TOTAL3 - tb_Open
expression =FormatNumber(Code.GetClosing(ReportItems!tb_TOTAL3.Value,ReportItems!tb_Open.Value))
My custom code:
Dim Shared prev_close As Double
Dim Shared now_close As Double
Dim Shared now_open As Double
Public Function GetClosing(TOTAL3 as Double,NowOpening as Double)
now_close = TOTAL3 + NowOpening
prev_close = now_close
Return now_close
End Function
Public Function GetOpening(Month as String,NowOpen as Double)
If Month = "1" Then
now_open = NowOpen
Else
now_open = prev_close
End If
Return now_open
End Function
Thanks alot for your help!
Regards
Panda ALooks okay to me.
Perhaps the variables should be declared as public (?) -
Here is a link to a jpeg representing what I need to see, this screen shot was taken from a tutorial.
http://shadowworkmovie.com/Archive/cursor.pngThe update solved it.
InDesign CS6 8.0.1 Update -
Compare 2 data sets and display the last record
I have one record in first table and 2 records in second table.
Ex:Table 1:
A 100 200 0
B 200 300 0
Table 2:
A 0 0 100
A 0 0 500
B 0 0 700
In one final template I want to display like below with only 2 records like below.
A 100 200 500
B 200 300 700
Anybody suggest me how to pick only last record if the count is greater than 1 in second table.not sure what are you trying to do
if you want to join two table then sql is more useful IMHO
Anybody suggest me how to pick only last record if the count is greater than 1 in second table.
you can get last record by last() function
<?for-each:SOMETAGorGROUP[position()=last()]?> -
Creating search help for AFNAM, and display the hit list with values only
Hi guys,
I have created a search help for AFNAM, but the hit list displays all even if it is blank.
I want to display in the hit list the AFNAM with values and do not diplay the blank values...
Is it possible? How am i going to do it?
Thanks!
MarkHi Mark,
After selecting data use this statement.
DELETE it_table WHERE AFNAM is initial.
Regards,
Suneel G -
Can't find the proper sdk exe to start and run the SDK along with classes
Hello:
I have downloaded the java sdk development, several versions of it. However, I cannot find not one proper exe file that will open the sdk development interfaces. I have searched my computer and it does seem that I have all the files such as bin, ect... , even some sample classes, except for the main sdk exe that will open the java classes. So, I need some help with this issue, which would be greatly appreciated.
RecencyThe SDK is not one single executable. And to "open java classes" doesn't really mean anything.
You'll want to start here:
http://download.oracle.com/javase/tutorial/getStarted/cupojava/index.html
Perhaps by "executing the JDK", you're talking about an IDE? If so, the NetBeans link on that page is what you're looking for. However, I strongly advise you to avoid IDEs and do things with a simple programmer's editor and command line until you a) have a good grasp of the language basics, and b) are clear on the concepts of language, IDE, JDK, and core API, and what separates one from the others. -
Extract Year (only) from Date Field and Display in Text Field
I need to extract the year from a user entered date field and display the year in a text field. Can someone help me with the correct script to do this?
Hi,
that's quite easy to realize with FormCalc.
In you date fields exit event add the following code:
textField1 = Num2Date( Date2Num($.formattedValue, "MM/DD/YYYY"), "YYYY")
Note: This sample assumes that your date field formats the date with "MM/DD/YYYY". You may have to change the pattern to make it work at your end. -
How to add one date column and charecter column
hi all,
i have 3 column start_date(date),end_date( date),duration (varchar2)
i am trying to add start_time and duration like this
end_date := to_char(start_time) + duration;
but its showing value_error
how to add one date column and charecter column.
Thanksyou need something that does:
end_date (DATE) := start_date (DATE) + <number of
days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
e.g.
SQL> ed
Wrote file afiedt.buf
1 with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
2 -- END OF TEST DATA
3 select start_dt + duration_days
4* from t
SQL> /
START_DT+
04-JUL-07 -
How to Read the one Source Column data and Display the Results
Hi All,
I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
Ex:
Pr_ProjectType
AD,AM
AD
AM
AD,AM,TS,CS.OT,TS
AD,AM
like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
4.AD,AM,TS,CS.OT,TS in this string we need AD,AM only.
this logic we need we have thousand of data in the table.Please help this is urgent issue
vasuHi Vasu,
Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
are two approaches for your reference:
Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
for the custom function is as follows:
CREATE FUNCTION dbo.udf_GetNumeric
(@strAlphaNumeric VARCHAR(256))
RETURNS VARCHAR(256)
AS
BEGIN
DECLARE @intAlpha INT
SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
BEGIN
WHILE @intAlpha > 0
BEGIN
SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
END
END
RETURN ISNULL(@strAlphaNumeric,0)
END
GO
The SQL commands used in the OLE DB Source is like:
SELECT
ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
FROM MyTable
Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
characters to the corresponding substring. The script is as follows:
using System.Text.RegularExpressions;
Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
References:
http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/
http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html
Regards,
Mike Yin
TechNet Community Support -
How to change colors of individual column bar in the same data series
in mac numbers, how to change colors of individual column bar in the same data series. The entire column series gets selected in the column bars and cannot select to change colors of specifc bars.
Hi Kiran,
no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
Regards,
Govindu -
How can I select a date to view in Calendar while I am in month view?
I am looking at month view in Calendar on my iPad. I touch a date. Intuitively, I expect that date to open up in Day or Week view, but it doesn't! On my iphone, it works just fine. Am I missing something?
How can I select a date to view while in Month view and have it go to Day or Week view?
Thanks for any help.I would try this:
In Lr import one photo into a different folder that you can see in the list.
Then in your OS (mac Finder / Win Explorer) move the photo to the folder that you cannot see.
In Lr the photo will now appear with a question mark on its frame. Click directly on the question mark and select <Locate photo>. Navigate to the folder, open it, and click on the photo.
Maybe this will help Lr to recognize the folder.
If this doesn't help try renaming the folder in your OS. -
How to convert a note in pdf and put the data in the structure SOOD4
Good day!
I'm using CONVERT_OTFSPOOLJOB_2_PDF.
This function SO_DOCUMENTS_MANAGER selects a note from uploading and fills the structure SOOD4 with the file data.
Need to do this automatically, convert to pdf and fill the structure SOOD4If I got your point correctly, you may use the function module SO_OBJECT_CREATE. Take a look at the thread below for an example on how to use it.
Attachments to Material Master
Regards,
Felipe
Maybe you are looking for
-
Can't download Itunes to my new computer using windows 8.1
I have tried to download Itunes and it pulls up the selection of a directory and then does nothing
-
Deploying Crystal Reports runtime using merge module failed
Hi, I am having a problem when deploying Crystal Reports using merge module runtime, included into MS Visual Studio web setup project, when installing my *.msi with CR runtime on a completely clean PC (with only MS Windows installed). Error: Failed t
-
Canon UFRII not working with IR C5180
Sadly I spent hours on this issue at a client yesterday with no resolution. Not using UFR but just the Canon PPD I can print fine from all stations (both 10.5 and 10.6). The client needs to be sending department ID's along with the print jobs for acc
-
I have a MacAir recently installed with Aperture. All my photo's are currently stored on external hard drive in 100s of folders. How do I upload all these photos in their folders to iCloud. My iCloud storage is 200GB.
-
Hi guys, I have the following problem with bookmarks. The bookmarks store navigation state of the web template. The problem is, if I create a couple bookmarks und after that I change something in the web template (e.g. add additional dropdown item)