(time function need) how to convert p.m. to normal in SQL?
Hello guys,
I have got time column in my table, however, by mistake values have been added like below.
2:57:34 pm
It should have been 14:57:34
What should I do for this?
Thank you
What is column datatype? Is it varchar2? If so, it is bad design. Anyway, if it is varchar2 and all values are in hh:mi:ss am/pm:
update your_table
set your_column = to_char(to_date(your_column,'hh:mi:ss am'),'hh24:mi:ss')
/SY.
Similar Messages
-
How to convert string to an integer in SQL Server 2008
Hi All,
How to convert string to an integer in sql server,
Input : string str="1,2,3,5"
Output would be : 1,2,3,5
Thanks in advance.
Regards,
SunilNo, you cannot convert to INT and get 1,2,3 BUT you can get
1
2
3
Is it ok?
CREATE FUNCTION [dbo].[SplitString]
@str VARCHAR(MAX)
RETURNS @ret TABLE (token VARCHAR(MAX))
AS
BEGIN
DECLARE @x XML
SET @x = '<t>' + REPLACE(@str, ',', '</t><t>') + '</t>'
INSERT INTO @ret
SELECT x.i.value('.', 'VARCHAR(MAX)') AS token
FROM @x.nodes('//t') x(i)
RETURN
END
----Usage
SELECT * FROM SplitString ('1,2,3')
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Album: how to convert burst photos to normal ones?
How to convert burst photos to normal ones?
Got it.This is how you do it.You can only later select other picture if you want.You cannot save them all.After you take a picture,go to the album and tap on the icon for timeshift,it will take you back to select which one you like.
All we have to decide is what to do with the time that is given to us - J.R.R. Tolkien -
How to convert SQVI to a normal query in SQ01 under client-specific query
Dear all,
I would like to know how to perform the following. Can you show me step by step as I don't know how to use SQ01 nor SQVI.
Convert SQVI to a normal query in SQ01 under client-specific query area
Thanks
tuffy
Thien is right. Invest some time into researching the above mentioned topics before turning to the forums for help.
Edited by: kishan P on Aug 25, 2010 10:24 AMHi,
If you don;t know any of them. I think you should take a little time to research or search from Google, SDN wiki,...
regards, -
How to convert milliseconds to date format in sql query
Hi All,
The following code is in java.
String yourmilliseconds = "1316673707162";**
Date resultdate = new Date(Long.parseLong(yourmilliseconds));
could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)Hello,
http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
Regards -
How to convert Oracle User defined datatype to SQL Server 2014 using SSMA Version 6.0
I am trying to convert Oracle 11g OE schema to SQL Server 2014, using SSMA version 6.0
Getting an error in converting the Oracle View to SQL Server
CREATE OR REPLACE VIEW OC_CUSTOMERS OF OE.CUSTOMER_TYP WITH OBJECT IDENTIFIER (customer_id) AS
SELECT c.customer_id, c.cust_first_name, c.cust_last_name, c.cust_address,
c.phone_numbers,c.nls_language,c.nls_territory,c.credit_limit,
c.cust_email,
CAST(MULTISET(SELECT o.order_id, o.order_mode,
MAKE_REF(oc_customers,o.customer_id),
o.order_status,
o.order_total,o.sales_rep_id,
CAST(MULTISET(SELECT l.order_id,l.line_item_id,
l.unit_price,l.quantity,
MAKE_REF(oc_product_information,
l.product_id)
FROM order_items l
WHERE o.order_id = l.order_id)
AS order_item_list_typ)
FROM orders o
WHERE c.customer_id = o.customer_id)
AS order_list_typ)
FROM customers c
* SSMA error messages:
* O2SS0461: Conversion of object view is not supported.
* OF OE.CUSTOMER_TYP
* WITH OBJECT IDENTIFIER (customer_id)
CREATE VIEW dbo.OC_CUSTOMERS
AS
/*Generated by SQL Server Migration Assistant for Oracle version 6.0.0.*/
* SSMA error messages:
* O2SS0481: Conversion of statement containing user defined type column 'c.cust_address' not supported.
* O2SS0481: Conversion of statement containing user defined type column 'c.phone_numbers' not supported.
* O2SS0430: Conversion of multiset conditions is not supported.
* CAST(MULTISET
* SELECT
* o.order_id,
* o.order_mode,
* MAKE_REF(oc_customers, o.customer_id),
* o.order_status,
* o.order_total,
* o.sales_rep_id,
* CAST(MULTISET
* SELECT
* l.order_id,
* l.line_item_id,
* l.unit_price,
* l.quantity,
* MAKE_REF(oc_product_information, l.product_id)
* FROM order_items l
* WHERE o.order_id = l.order_id
* ) AS order_item_list_typ)
* FROM orders o
* WHERE c.customer_id = o.customer_id
* ) AS order_list_typ)
SELECT
c.CUSTOMER_ID,
c.CUST_FIRST_NAME,
c.CUST_LAST_NAME,
c.cust_address,
c.phone_numbers,
c.NLS_LANGUAGE,
c.NLS_TERRITORY,
c.CREDIT_LIMIT,
c.CUST_EMAIL,
NULL
FROM dbo.CUSTOMERS AS c */
Any suggestion on converting this view would be helpful.
Kind regards.Thanks Lydia Zhang for your reference urls.
Please let me know if you come across any reference articles related to
Creating a SQL Server table and View with columns as SQL Server TVP similar to Oracle UDT like
CREATE TABLE "OE"."CUSTOMERS"
( "CUSTOMER_ID" NUMBER(6,0),
"CUST_FIRST_NAME" VARCHAR2(20 BYTE) CONSTRAINT "CUST_FNAME_NN" NOT NULL ENABLE,
"CUST_LAST_NAME" VARCHAR2(20 BYTE) CONSTRAINT "CUST_LNAME_NN" NOT NULL ENABLE,
"CUST_ADDRESS" "OE"."CUST_ADDRESS_TYP" ,
"PHONE_NUMBERS" "OE"."PHONE_LIST_TYP" ,
"NLS_LANGUAGE" VARCHAR2(3 BYTE),
And also creating a SQL Server TVP inside an another SQL Server TVP as in Oracle
create or replace TYPE customer_typ
AS OBJECT
( customer_id NUMBER(6)
, cust_first_name VARCHAR2(20)
, cust_last_name VARCHAR2(20)
, cust_address cust_address_typ
, credit_limit NUMBER(9,2)
, cust_email VARCHAR2(30)
, cust_orders order_list_typ
NOT FINAL;
Kind regards.
Venkatesha -
HELP NEEDED - How to convert a .ram file into .aac???
Hi
I am downloading radio programmes and the files downloaded all have a .ram extension.
When double clicking on the files, iTunes opens but does not put the file in the library nor plays it.
I tried the option 'importing' and 'add to library', but no reaction from iTunes either.
Can someone out there help???
Thank you so muchMike is correct above. Use RealPlayer to play the .RAM files, and use AudioHijack to record them to AIFF or MP3.
http://www.rogueamoeba.com/audiohijack/ -
How to convert from ifs date format to sql based dates
I want to write a sql query using dates, to search an ifs
database. Ifs stores dates as numbers created using the
java.util.Date class. These dates are accurate to seconds.
PLSQL uses a different format.
What I need is a PLSQL function that converts PLSQL date format
to and from the java.util.date format.
This is an example of what I would like to do.
String classname = "DOCUMENT";
String whereclause = "CREATEDATE > theNeededFuction(to_date('01-
Jan-2001', 'DD-Mon-YYYY'),'j')";
Selector mySelector = new Selector(login.getSession());
mySelector.setSearchClassname(classname);
mySelector.setSearchSelection(whereclause);
I do realize that I could simply convert the date in java, but
in the long run, I want to use the oracle tools that support
busness day calulations.
-MitchHi Mitch - our ViewSpecification functionality automatically
includes an Oracle Date column, which is derived from the java
date values we store. These views are the supported way of
performing read-only operations against an iFS instance.
For yor reference, the Oracle date column is derived using the
following SQL operation (e.g. for createdate):
to_date('01-JAN-1970', 'DD-MON-YYYY') + (createdate/86400000)
regards,
dave -
How to Convert SMO Date property to a SQL DateTime
Hi,
I am retrieving the SMO Database CreateDate property and trying to insert this into a T-SQL DateTime column. The following is a sample of Powershell code to retrieve this property:
$serverA.Databases[0].CreateDate
The format of the CreateDate returned is "Monday, October 03, 2011 10:31:25 AM" and I would like it to be in this format: "2011-10-03 10:31:25" for inserting into a SQL 2012 table. Is there a function or method that will
retrieve the CreateDate in this format?
Thanks for all your help.
Gary
GaryAlso, it's a .NET DateTime, not a String.
PS SQLSERVER:\SQL\DBROWNE2\DEFAULT> $serverA.Databases[0].CreateDate.GetType()
IsPublic IsSerial Name BaseType
True True DateTime System.ValueType
So insert it using a parameter and you won't ever have to convert it to a string.
David
David http://blogs.msdn.com/b/dbrowne/ -
How to convert et_attach-phio_content into normal character format.
Hi All ,
We need to convert the et_attach-phio_content
which is type of
SDOK_SDTX(data type = RAW ,length = 1022)
into type
solisti1 (data type = SO_TEXT255 )(char).
please help .
Regards
ChannappaHi All ,
We need to convert the et_attach-phio_content
which is type of
SDOK_SDTX(data type = RAW ,length = 1022)
into type
solisti1 (data type = SO_TEXT255 )(char).
please help .
Regards
Channappa -
Video Format Total Solution: How to Convert and Edit Video on Windows/Mac
More and More video formats are coming out with different video encoders and it makes our spare time more and more colorful. However, it is not to say that there is no problems. Actually, different video formats make it difficult to share video with others, even your own camcorder and iPod. Is there an easy way to convert videos effectively. Yes, there is.
In this article, I will show you guys how to convert videos on windows and mac.
Part 1. How to Convert and Edit Videos on Windows
For Windows users, you need a Video Converter(http://www.aiseesoft.com/total-video-converter.html) to do that for you.
Here I use Aiseesoft Total Video Converter(http://www.aiseesoft.com/total-video-converter.html)
Step 1: Download and install Aiseesoft Total Video Converter
After you download it to your computer, double click it and it is really easy to install.
You just need to click “next” and it will complete it in seconds. It will automatically run after installation.
http://www.aiseesoft.com/images/guide/total-video-converter/screen.jpg
Step 2: Load Video
Click “Add File” to find the video that you want to convert and click “open”. It will be loaded automatically.
Step 3: Select the target to decode
In the “Profile” drop download list you can find your target according the usage of your output video, such as if you want to put the video on your iPod touch, you can select the “iPod” in the first list and “iPod touch 2 MPEG-4 640*480(*.mp4)” in the second list.
Step 4: Set Advanced Parameters
After you select the right output profile, you can click “setting” button to set your advanced parameters. You can adjust video and audio settings separately. In video section, you can change “video encoder”, “resolution”, “frame rate”, “video bitrate”In audio section, you can change “audio encoder”, “sample rate”, “channel”, “audio bitrate”If you want to save this profile and settings and use it next time you can click “save as” button to give a name to it. And the next time you want to use it you can find it in the profile list named “user defined”.
Step 5: Choose a Destination
To browse and find a output folder for your output files or just the default one.
Finally, Click “Convert” button to begin your conversion, here in the converting
interface you can choose “shut down the computer when conversion complete” or “open output folder when conversion complete” or you just do not choose neither one.
Tips: How to Edit the Output Video
This video converter is also a video editor, you can use it to edit your output video as follows:
http://www.aiseesoft.com/images/guide/total-video-converter/effect.jpg
1. Effect:
You are allowed to adjust the “Brightness”, “Contrast”, “Saturation” and you can choose the “deinterlacing” to make the video more enjoyable.
2. Trim:
In “Trim” section you can pick up any part of the video to convert.
There are two ways to select the part of the video you want. One is set the start and end time in the box. The other one is to drag the start and end button in the processing bar.
3. Crop:
This function allows you to choose a certain play area to convert. That means you can choose a part of the screen you like to convert. For example, you just like the tv in the middle of the screen, then you can drag the frame around the preview window to select the tv and the output preview will show you the output video.In this section you can also choose the “zoom mode”, such as “keep original”, “full screen”, “16:9”, “4:3”.
4. Watermark
In the section, you can add a watermark on the output video to show people something, such as your name, website, studio name or other things. The watermark could be words and picture. You can adjust the transparent of the watermark easily to make it more beautiful.
Part 2. How to Convert Video on Mac
This time you need a Video Converter for Mac(http://www.aiseesoft.com/video-converter-for-mac.html)
Step 1: Add File
Click “Add File” button to load the video you want to converter
http://www.aiseesoft.com/images/guide/mac-video-converter/steps.jpg
Step 2: Choose profile and adjust settings
You can find your output video format from a drop-list called “Profile”You can also adjust the specific settings of the output video, such as “Resolution”, “Bitrate”, “Encoder” and so on.@ Tamwini
Your only goal is to sell software.
‡Thank you for hitting the Blue/Green Star button‡
N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009 -
How to convert string to 16 characters.
My external unique id is too long, more then 30 characters.
How to convert it to 30 characters using sql?You should find another extranal system id in order to mantain uniqueness, but you could also use the name field (that supports 50 characters), but it deppends of which entity you are using.
Which is the entity? and...if the only way to insert data is by web services the you could use more than one field to verify uniqueness since you can query more than one field at the time.
Hope it helps
Kim. -
How to convert SQL server stored procedures to Oracle 11g
Hi Experts,
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
Please help me,
Thanks.ramya_162 wrote:
In SQL server 30 stored procedures are there how to convert all the stored procedure
from SQL server to Oracle 11g.
The single most fundamental concept you need to understand (grok in its fullness) is:
ORACLE IS NOT SQL-SERVER
There is very little, to NOTHING, in common between T-SQL (a language extension to SQL) and PL/SQL (integration of SQL with the language Ada, part of ALGOL family of languages that includes Pascal and C++).
So taking a T-SQL procedure and porting it as is to PL/SQL is plain stupid.
Why?
Oracle sucks at trying to be SQL-Server.
So how do you migrate from SQL-Server to Oracle?
By taking the REQUIREMENTS that the T-SQL procedures address, and addressing these requirements using Oracle SQL and PL/SQL. -
How to convert CLOB data (now it is in html format) to Normal text format
Hi,
Can anybody let me know the solution for how to convert CLOB data into normal Text.In my case the table column having CLOB datatype and the data is in html format.when i run the report the column is displaying html tags .Now i need to convert that html tags into normal text.
Pl. let me know if any one know the solution.
Regards,
Thulasi.KLONG has been depricated since 8i so I don't believe there is a general solution to go backwards short of reloading the data.
Justin -
How to convert MDX query to SQL
Hi everyone,
can you please suggest me, how to convert the below mdx query to sql query. can you please tell me what it is doing?
CREATE MEMBER CURRENTCUBE.[Measures].[calculation]
AS IIF(([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark]) = 0, NULL,
([Measures].[ Total Shipped],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])/
([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])),
FORMAT_STRING = "Percent",
VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Sale';
Thanks
VishuHi Vishu,
As Olaf said, this is a calculated member which used in MDX script in your cube, we cannot execute it in SQL Server Management Studio directly. Here are some document about calculated members and MDX script for your reference.
Defining Calculated Members
MDX Scripting Fundamentals (Analysis Services)
Regards,
Charlie Liao
TechNet Community Support
Maybe you are looking for
-
I have operational PC skills but have never looked at an Ipad. I'm trying to help a friend with no PC skills learn to use her new (April 29 purchase) Ipad. She was very frustrated and gave up on it shortly after buying it. Initially she had support c
-
Use Firefox V 5, Windows 7 on a Dell computer.
-
How to generate a dynamic column with unique value in AMDP
Hi Collegue, For AMDP I have a table with material plant,i have to assign a unique number to each unique combination of material,plants into a dynamic column say sequence. Please suggest me how to proceed. Regards, Saurabh
-
Agregated value in original report in not same as the drill down report
Hello experts, I have a issue with the drill down reports. Agregated value in the main report is not equal to the agregarated value in the drill down report. In my report I have a sales for jan 2011,feb 2011 so on For jan 2011 it is some thing $56000
-
Hi, what does message mean: 'r415.local' Thank you