How to convert from Datetime to number?
chg_date_time
40265.492
SELECT c.chg_date_time, TO_DATE('01011900','DDMMYYYY')+CHG_DATE_TIME FROM CHNGHIST C
After execute:
30/03/2010 11:48:29
In the above query, we convert number to datetime.
Now I want to convert from Datetime to number.
i.e., 30/03/2010 11:48:29 = ? (40265.492)
Thanks
Nihar
Hello,
This would do it :SQL> select to_date('30/03/2010 11:48:29','dd/mm/yyyy hh24:mi:ss') - TO_DATE('01011900','DDMMYYYY') nmbr from dual;
NMBR
40265,492
1 row selected.
Similar Messages
-
Hi,
I want to convert from date to number. How can I do?
Thanks
[email protected]That rather depends on what sort of number you want.
You can probably get what you want by a combination of to_char and to_number. -
How to convert from military time (string) to regular time?
How to convert from military time (string) to regular time?
First of all I need to let you know I'm very new to Crystal Reports, so I apologize and will need detailed instructions if possible.
I have created a Crystal Report pulling information from the received time field. On the report, the time is showing in military time (ex. 16:00:00).
How can I convert this time to normal time (ex. 4:00:00)
Since the field is a 'String' field and not a 'Time' field, I do not have the option of changing it under the field properties.
I hope someone can help with this.
Thank you in advance.As my fields were date only and not datetime, I ended up using the following,
If IsDate({CallLog.EmailRecdDate}) Then
CDate({CallLog.EmailRecdDate})
Else
CDate(0,0,0)
You answer lead me in the right direction.
I'm still having an issue with the 'Else' statment returning 12:00:00 because of the CDate(0,0,0), but I'm not sure what else I can use to return a blank space on the report. Any ideas?
Thanks again! -
Re: How to converting from PL/SQL query to T-SQL query
How to converting from PL/SQL query to T-SQL query... Its Urgent
Download the
SQL Server Migration Assistant for Oracle. It will convert whole Oracle databases, or single queries or PL/SQL stored procedures.
With caution that If your database is using Collation which is case sensitive SSMA will not work.SSMA doesnt guarantees 100% for conversion of Queries/stored proc /database if it fails to do so for some queries you will have to do it manually.
But you can try
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Hi iam new to java can u tell me how to convert from hashmap to string
how to convert from hashmap to string
Hi,
This is not pure Java forum. Its more on JDBC and data connectivity to Orcle db from Java API.
This link may answer your question:
http://stackoverflow.com/questions/960807/hashmapkey-string-value-arraylist-returns-an-object-instead-of-arraylist
Twinkle -
How to convert from Restricted material to Unrested Material
Hi Every Body,
I have Posted the Batch Material in MB1C . But it was posted in RESTRICTED IN USE. How to convert from Restrict To UNRESTRICTED IN USE. Can Anybody Help me.Thank you for solving the problem both SAP Community Network and Mr Jurgen .
suribabu -
How to convert from image based pdf to text based pdf
I have Adobe 9 Pro. How to convert from image based pdf to text based pdf? For example, if someone emails a scanned pdf to me, how do I convert that document into a text based pdf?
To perform OCR, open the document and select: Document > OCR Text Recognition > Recognize Text Using OCR
More information on the various options is in the Acrobat help doc. -
How to convert from java.lang.Integer to int
Could you please show me
how to convert from java.lang.Integer to int?
and how to convert from java.lang.Integer to String?
Thanks,
MinhCould you please show me
how to convert from java.lang.Integer to int?
and how to convert from java.lang.Integer to String?Tip: always keep a browser open on the API docs; if you've got a
couple of MBs to spare, download the docs; it's very convenient.
kind regards,
Jos -
How to convert from array to graph ?
how to convert from array to graph ?
A graph will accept an array of numbers. Do you have an example of what you are looking for?
And since somebody mentioned tutorials...
3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to convert from pdf to word
how to convert from pdf to word
If you are using Adobe Acrobat please post here: http://forums.adobe.com/community/acrobat/creating__editing_%26_exporting_pdfs
If you are using Adobe Reader and ExportPDF, please read this: http://forums.adobe.com/docs/DOC-1812 -
How to convert from XML to Array ?
how to convert from XML to Array ?
thanks in advancethis is a segment of the xml object:
var myXML:XML =
<data>
<task>
<taskID>2</taskID>
<startDate>2/15/2007</startDate>
</task>
</data>
i want to conver myXML into ArrayCollection: like this:
private var expenses:Array = [
{taskID:"1", startDate:"2/15/2007"},
{taskID:"2", startDate:"4/15/2007"}
how i can do it ? and tell me how to retrieve the data from
the collection
thanks -
How to convert from lowercase letters to uppercase letters?
how to convert from lowercase letters to uppercase letters?
Hi KS,
In the transfer / update rules you can use a formula to convert lowercase to upper case letters.
Functions for Character string>>TOUPPER(CHAR)
Hope this helps.
Bhargava
Message was edited by:
Sista Bhargava Kumar -
How to convert from xml file to html using java code
How to convert from xml file to html file using java code
Get yourself Apache Xalan or Saxon or some XSLT processor
String styleSheet = "/YourXSLTStylesheet.xsl";
String dataSource = "/YourXMLDocument.xml";
InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
OutputStream transformedOut = new FileOutputStream("filename.html");
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
http://www.w3schools.com/xsl/ -
How to convert from varchar to blob ?
How to convert from varchar to blob ?
thanksHere is a small PL/SQL block that we have used to convert varchar2 to blob.
declare
cursor get_blob is
select blob_statement
from report
where report_id = 205
FOR UPDATE OF blob_statement;
v_loc blob;
v_raw_buffer raw(32767);
v_amount binary_integer := 32767;
v_offset binary_integer := 1;
v_buffer VARCHAR2(32767);
begin
open get_blob;
fetch get_blob into v_loc;
close get_blob;
v_buffer := 'Sample text';
v_raw_buffer := utl_raw.cast_to_raw(v_buffer);
v_amount := utl_raw.length(v_raw_buffer);
dbms_lob.write(v_loc, v_amount, v_offset, v_raw_buffer);
commit;
end; -
How to convert from Grayscale to single color channel
I hope that someone here might be able to help. I am writing an application which loads in color channels separately, to be merged by the application The images are multi-page TIFF files. The trouble that I am running into is that the application loads the images into grayscale, so when I merge the channels, they are merged as grayscale, not as the correct colors.
I use the following on each color channel to load them in:
public static BufferedImage[] loadTiff(File multiPageFile, int colour) {
BufferedImage[] img = null;
ArrayList<BufferedImage> tmp = new ArrayList<BufferedImage>();
try {
SeekableStream stream = new FileSeekableStream(multiPageFile);
String[] names = ImageCodec.getDecoderNames(stream);
ImageDecoder dec = ImageCodec.createImageDecoder(names[0], stream, null);
int numPages = dec.getNumPages();
for (int i=0; i<numPages; i++) {
try {
RenderedImage im = dec.decodeAsRenderedImage(i);
BufferedImage bi = PlanarImage.wrapRenderedImage(im).getAsBufferedImage();
//In case not all pages are valid images, we use ArrayList as it is dynamic
tmp.add(bi);
}catch (RuntimeException re) {
//Once the exception is caught, we can decode the layer here for whatever means.
}catch (FileNotFoundException fnfe) {
System.err.println("File not found.");
fnfe.printStackTrace();
}catch (Exception e) {
System.err.println("General Exception caught");
e.printStackTrace();
//Convert to an array to be returned.
img = new BufferedImage[tmp.size()];
for (int i=0; i<img.length; i++) {
img[i] = tmp.get(i);
return img;
}So a BufferedImage array is returned (one element in the array for each page in the multi-page file). Before I return the BufferedImage array, though, it would be good to convert it to the correct color. I know which channel is currently being loaded. Does anyone have any tips on how to shift from a grayscale intensity to a single color intensity? I have tried a number of things regarding byte shifting, but I am really none the wiser.
I have tried, for example, reading the int color value:
int color = bi.getRGB(w,h);The trouble is that this number is not in the region 0..255, so I don't know how I can use it. If I shift the number:
color = color>>16I get a number smaller than 255 (although it seems to be negative), but I don't know whether I can use this value for a single color channel, i.e. if the current color is red, saying:
Color redC = new Color(color, 0, 0);
bi.setRGB(w,h,redC); //Slow and inefficient. There must be a better way.When I try doing that, I end up with nothing drawn or visible.
Does anyone have any ideas? Thanks in advance.
Edited by: doughnuts64 on Jun 12, 2008 6:27 AMThanks for the response. It has been helpful in getting my problem sorted. I was not creating a new BufferedImage - I was just using the one that had been loaded in, and as such had not realised that the type was not TYPE_INT_RGB. As soon as I instantiated a new BufferedImage of the same dimensions and colour TYPE_INT_RGB as you suggested, it worked! So thanks for that.
Whilst that does work, it does slow the application incredibly as it has so much data to cycle through. Ideally, I would be able to load the image in directly as the colour channel in question, rather than loading in as grayscale. This way, the application would only require the amount of time needed to load in the images, not to process them on a pixel-by-pixel basis (typical images are made up of over 16,000,000 pixels for each colour channel, and we typically load two files in at once - both for separate colour channels, so over 32,000,000 pixels to process).
As I am loading in multi-page tiff files, I am having to use the JAI (Java Advanced Imaging) toolkit. I use the following code to load in my multi-page tiff into a BufferedImage array, where each element of the array represents one of the 'pages' in the multi-page tiff file:
SeekableStream stream = new FileSeekableStream(multiPageFile);
String[] names = ImageCodec.getDecoderNames(stream);
ImageDecoder dec = ImageCodec.createImageDecoder(names[0], stream, null);
int numPages = dec.getNumPages();
BufferedImage[] finalImage = new BufferedImage[numPages];
for (int i=0; i<numPages; i++) {
RenderedImage im = dec.decodeAsRenderedImage(i);
finalImage[i] = PlanarImage.wrapRenderedImage(im).getAsBufferedImage();
//...colour changing code currently here - loops through finalImage array, and on every pixel of every layer
...To be able to automatically convert the colour channel without having to loop on every pixel (and thus save an incredible amount of loading time) would be helpful.
Thanks.
Maybe you are looking for
-
I am installing Windows 7 and I get an error message: "Your disk could not be partitioned. An error ocurred while partitioning the disk". I was using a Windows & Home Premium OEM Software that I purchased from Microsoft. I was given to Windows 100GB
-
How do you manage multiple users, iTunes and icloud
I haven't figured this out yet. I have an iTunes account, two daughters who buy most of the music on it but we all share the account. We all have Macbooks and iPhone 4 or 4S. I don't want to download their music and they don't want to download min
-
How do I change my default PDF viewer in Safari?
I recently downloaded Acrobat Reader. Ever since, when I have opened PDF files on the internet, they have opened in Acrobat. How on earth do I switch the default back to Preview, or the regular Safari pdf viewer? I don't want to view my internet PDF'
-
Why are photoshop icons showing up as color bars in AE6 even though the files are not missing?
I have imported the file numerous times, they actually show up in After Effects. If I render it renders fine, however the icons next to the photoshop files show up as color bars. Can anyone hep me figure this out?
-
Subcontracting and plants abroad
Dear all, I am facing the following problem: My customer are using plant abroad functionality. They are VAT registered and have plants in almost all contries within European Union. The will start using subcontracting functionality in SAP and they hav